[SOLVED] Using FLEXIcontent in the Frontend Template

More
10 years 1 month ago - 10 years 1 month ago #54725 by iamrobert
Hi,

In the main Front End template - not flexicontent - I want to append the body tag. I want to add a class:
Code:
<body class="hideflexi">
- if my field "show description" is set to "no"

Now - I know I can do this in item:
Code:
<?php if (($this->item->fields['showdesc']->display) == "No"):?>hideflexi<?php endif;?>

Is there anyway to do this in the site templates?

Thanks,

Robert
Last edit: 10 years 1 month ago by iamrobert.

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

More
10 years 1 month ago - 10 years 1 month ago #54732 by ggppdk
Hello

so you want to get the item inside e.g. Joomla template code,



-- see this FAQ article:
Retrieving the HTML DISPLAY of FC fields inside 3rd-party code

if current view is item view
note
- DB queries will only be redone once
- use
Code:
$itemid= JRequest::getInt('id')
to get the item ID



Also note taht you do not need to create the field 's HTML display... just after
Code:
$item = $itemmodel->getItem(..);

do:
Code:
if (isset($item->fieldvalues[56])) // 56 is the id of your field print_r($item->fieldvalues[56]); else echo "field has no value";

see more about the above here:
Using the raw value of a field inside a template file or inside a new custom field type


-- 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...
Last edit: 10 years 1 month ago by ggppdk.

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.340 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