Please note that Form2Content is no longer being developed. All files from the latest version can be found on Github.

Form2Content Forum

Questions and answers for Form2Content, a Joomla CCK.
  1. Stephen Shorter
  2. F2C Content type settings
  3. Tuesday, 29 September 2015
  4.  Subscribe via email
I'm very new to SQL DB's and programming so I hope this question is not too dumb.

Is there a way based on the selection from one f2cpro field that I can automatically populate another f2cpro field with a pre defined set of values.

For instance if I was to select "Colour_Set_1" the pre defined values may be "red" "blue" "green"
If I was to select "Colour_Set_2" the pre defined values may be "yellow" "red" "orange"

Importantly I want to be able to easily add values to "Colours" so that they are available to select as part of the Colour Sets. And, of course need to be able to create new colour sets.

Once I am able to define these sets I then want to be able to select one or multiple colour sets and utilise the values in colour as search terms for the articles created by f2cpro.

Any thoughts on how to achieve this?

I did think about creating a simple table of colour sets then using a metadata_keywords_contenttype_XX.tpl that is somehow driven from the colour sets but unfortunately my skills are not there at this point.

Or is what I am asking for custom dev work?

I'm using J3.4.4 and the latest version of f2cpro.

Cheers Shooter.
Accepted Answer
Accepted Answer Pending Moderation
Hi Stephen,

For setting meta data, there is a special plugin: F2C Metadata. With the help of a dedicated Smarty template, you can specify exactly the fields to 'inject' in your meta tags. In the template, you can check the selected publication and conditionally render the proper data for the meta tag(s).

Your {if} examples are taken out of context, so it's difficult to say why they don't work the way you want. I suggest that you first read the Smarty documentation and specifically chapter {if},{elseif},{else}. If you do exactly what it says, it will work.

Unfortunately I am not in the position to give any further support without some kind of commercial agreement. Therefore, if you need more help, get in touch with me directly so we can work something out.

Regards,

Pieter-Jan de Vries
-----
Tel: +31 78 6733626
Skype: pieter-jan.de.vries
E-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.
Web: http://www.obix.nl
Responses (11)
Accepted Answer Pending Moderation
Hi Stephen,

Thanks for the nice JED review :)
And than I see you have the only unanswered post on the forum!!

Your question is rather technical and also very custom.
Is there a way based on the selection from one f2cpro field that I can automatically populate another f2cpro field with a pre defined set of values.


The bottom line is NO, not out of the box.
BUT, yes there is a but, we have recently changed and made the form fields plugin based. This means you can create your own F2C Field.
It does however require php/mysql knowledge and not something I think for a novice (I can't program myself). We are also still working on some detailed documentation although the color picker field has inline documentation.

Maybe there is a practical solution. You display all the sets and program the template to only accept the first one filled out. This way users can only select/use one set and you mention that above the fields.

Regards,
Patrick
Please read the F2C documentation before asking questions! Thank you if you've done so ;)
  1. more than a month ago
  2. F2C Content type settings
  3. # 1
Accepted Answer Pending Moderation
Hi Patrick,

I think I understand your solution. BUT I don't think that is going to work well in the long run.

Is there anyway you could quote me on customisation. I'm actually not wanting to select colour sets but that was the simplest way to describe what I want.

I'll implement your solution now to get by as the client is anxious to test and release the site I am building for them but I would like something a little more "friendly" when it comes to their clients using the development.

I'm happy to give you access to the site so you can see what I am trying to achieve.

Cheers Shooter.
  1. more than a month ago
  2. F2C Content type settings
  3. # 2
Accepted Answer Pending Moderation
Hi Stephen,

Patrick drew my attention to your question. I am a web developer and Form2Content enthusiast, working closely together with Patrick on a regular basis. Other than Patrick, I am a technician with more than 30 years of programming experience. I am what you might call a full stack developer, with experience both in the front end (HTML, CSS, JavaScript) and back end (PHP, MySQL). I use Form2Content for most websites, creating custom overrides and add on's whenever necessary. These range from template overrides for front end input forms and complex Smarty templates to custom Smarty plugins and Form2Content fields.

If there is room in your client's budget, I might be able to help you out. But first I need to know in more detail what it is you are looking for. If you are interested, I think it's best if you get in touch with me directly.

Regards,

Pieter-Jan de Vries
-----
Tel: +31 78 6733626
Skype: pieter-jan.de.vries
E-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.
Web: http://www.obix.nl
  1. more than a month ago
  2. F2C Content type settings
  3. # 3
Accepted Answer Pending Moderation
Hi Pieter

I am looking for 2 things if possible.

Something that will allow me to nest {if} statements in smarty so that I can have an all encompassing {if} AND the concept outlined above. It is not a high budget site, in fact I am building it to help a friend so if it is likely to be a massive development then I will have to make do with the idea presented by Patrick.

Are you able to give me a rough idea of time/cost associated with you doing this piece of work?

Cheers and thanks for your reply.
  1. more than a month ago
  2. F2C Content type settings
  3. # 4
Accepted Answer Pending Moderation
Hi Stephen,

Nesting {if} statements in Smarty templates is basic Smarty. No magic. Just do it and if you do it syntactically correct, it will simply work :)

Your second request, the inter dependent select lists, depends largely on the precise requirements. Developing a custom field, can be expensive. However, we also have another feature request with possibly overlapping requirements. If we can combine the two, it's more cost effective for the both of you. But then I first need to know exactly what your requirements are.

Regards,

Pieter-Jan
  1. more than a month ago
  2. F2C Content type settings
  3. # 5
Accepted Answer Pending Moderation
Thanks Pieter-Jan

The smarty {if} doesn't seem to work when I write it as follows:

{if $string1 eq '1'} Do This stuff

{if $string2 eq '1'} Do this stuff

{elseif $string2 neq '1'} Do This stuff{/if}

{elseif $string1 eq '2'} Do This stuff {/if}

Should it? or what am I doing wrong?

Precisely here are my other requirements:
1. Provide customer with a list of publication names.
2. Based on the selected publication(s) add a known set of values AND the publication name(s) to the meta tag .

Future Requirement is ability to add publications and add OR the set of values associated with the publication.

It's probably not a super high tech requirement but when your sql knowledge is zip it's like flying to the moon!

Cheers Stephen.
  1. more than a month ago
  2. F2C Content type settings
  3. # 6
Accepted Answer Pending Moderation
Thanks Pieter-Jan

I'll be in touch via email after I speak with my friend to see what budget he has. Thanks for all your help I really appreciate it.

Kind regards
Stephen.
  1. more than a month ago
  2. F2C Content type settings
  3. # 7
Accepted Answer Pending Moderation
Hi Pieter-Van,

I have emailed you my request for commercial support. Please review email (could be in spam) and I look forward to your response.

Cheers Shooter.
  1. more than a month ago
  2. F2C Content type settings
  3. # 8
Accepted Answer Pending Moderation
Hi Stephen,

I'll look into the details of your request tomorrow.

Regards,

Pieter-Jan
  1. more than a month ago
  2. F2C Content type settings
  3. # 9
Accepted Answer Pending Moderation
Hi,

I think I have the same problem.

I use the following code which doesn't work:
{if $REF_URL1 eq '1'}url1{elseif $REF_URL1 eq '2'}url2{else}empty{/if}

If I use the following code it works
{if $REF_URL1_TEXT == 'referentie1'}url1{elseif $REF_URL1_TEXT == 'referentie2'}url2{else}empty{/if}

Jeroen
  1. more than a month ago
  2. F2C Content type settings
  3. # 10
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.