Field Parameters Frontend View

More
10 years 6 months ago #51175 by mauriestate
Hi,

I am having an important issue, based on our website requirements, I successfully make an integration in Flexicontent fields with www.planyo.com/ a hosted online booking solution.

Planyo provides a script that looks like this:
Code:
<iframe width='720' height='250' scrolling='auto' frameborder='0' src='https://www.planyo.com/embed-calendar.php?resource_id={{field67##0}}&calendar={{field66##0}}&style=multi-month&month-count=5&background=%23FFFFFF&custom-language=EN&'></iframe>

As you will see, I have replaced the resource ID and the calendar ID with a Flexicontent field that I previously created.

Now, I have 3 fields, the first one is the 'Calendar ID' field and the 'Resource ID' field where a user need to add his own calendar ID and resource ID when adding a new item.

The third field is invisible on both item submission form, and the third field has the 'Prefix text of every value' set to:
Code:
<iframe width='720' height='250' scrolling='auto' frameborder='0' src='https://www.planyo.com/embed-calendar.php?resource_id={{field67##0}}&calendar={{field66##0}}&style=multi-month&month-count=5&background=%23FFFFFF&custom-language=EN&'></iframe>

And the 'Default value' of this third field is &nbsp;

When filling information in the two previous fields, everything work as expected and the third field shows the exact information required on the frontend.

Now, the issue is that, not all users do have access to add their information about their Planyo account as they need to purchase the required subscription to get access to the Planyo feature.

But our issue is that, since we have set the third plugin to 'Default value use to 'The above & also display it instead of empty'. And of course, the third field is visible on the frontend even if the user has not provided information about the two previous fields!

What we need to be able to do is simply make the third field hidden if information is not provided in the previous two fields! Is it possible to handle this?

Offering professional real estate and investment services in Mauritius. Visit us at www.sjkestate.com to also see the power of Flexicontent with Joomla to promote our services.

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #51177 by mauriestate
I forgot to provide the live link where you may see it in action:

This one is where a user has not provide the field information for the site ID and resource ID. You can see the field information under the 'Availability Calendar' tab.
www.mygolfsocial.com/2014/international-...vate/6-test-course-3

This one is where a user has provided the field information for the site ID and resource ID. Again, you can see the field information under the 'Availability Calendar' tab.
www.mygolfsocial.com/2014/international-...e/3-test-golf-course

Offering professional real estate and investment services in Mauritius. Visit us at www.sjkestate.com to also see the power of Flexicontent with Joomla to promote our services.

Please Log in or Create an account to join the conversation.

More
10 years 6 months ago #51181 by ggppdk
Hello

you can check if fields were set:

Using the raw value of a field inside a template file or inside a new custom field type

you can try to skip the availability TAB if values of field are not set

you need to copy
components/com_flexicontent/tmpl_common/item_layouts/modular(_html5).php
to
components/com_flexicontent/templates/mycustom1/
item(_html5).php
and then replace:
Code:
<!-- tabber start --> <div id="fc_bottom_tabset" class="fctabber group"> <?php for ($tc=1; $tc<=$tabcount; $tc++) : ?>
with
Code:
<!-- tabber start --> <div id="fc_bottom_tabset" class="fctabber group"> <?php // *** CUSTOM CODE START // IDs of fields $siteid_field_id= 55; $resourceid_field_id= 56; // VALUES of fields $fvals_siteid = $item->fieldvalues[$siteid_field_id]; $fvals_resource_id = $item->fieldvalues[$resourceid_field_id]; // *** CUSTOM CODE START ?> <?php for ($tc=1; $tc<=$tabcount; $tc++) : ?> <?php // *** CUSTOM CODE START if ((empty($fvals_siteid) || empty($fvals_resource_id)) && $tc==5) continue; // *** CUSTOM CODE END ?>

please SET field -IDs- above and also correct PHP syntax error if there is a syntax error


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.294 seconds
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save