How to display a field in a module template?

More
3 years 11 months ago #78588 by grabit
I need to display a field in a A tag around my item the href of the link is in a field called "slideshow-link".

As I have also other custom fields displayed elsewhere, I planned to write the link directly in the template but it is not rendering.

I used that method:
Code:
<?php $myfield_html = FlexicontentFields::getFieldDisplay($item, 'slideshow-link'); echo '<a class="uk-cover-container uk-transition-toggle uk-display-block uk-link-reset" tabindex="0" href="' . $item->fields['slideshow-link']->display .'">'; ?>

The answer for the href is /

Any idea why it is not working?

An Apple a days keeps the doctor away

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

More
3 years 11 months ago #78590 by micker
hello
1 you need to allow field in module option
2 check the code

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
3 years 11 months ago #78591 by grabit
Where can i allow the field in the module option?

An Apple a days keeps the doctor away

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

More
3 years 11 months ago #78593 by micker
go to
layout
content via parameters
scroll down to custom field and allow display field

check news.php file to check code
github.com/FLEXIcontent/flexicontent-cck...t/tmpl/news.php#L842
i recommend you create your template output
copy news.php / news.xml and edit file

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
3 years 11 months ago #78595 by grabit
That is what I did. As I need to display other fields I use already that part. My need is to have a link around the item that’s why I did my template like that. My concern is that I followed the tutorial of ggppdk and it is not working. ( www.flexicontent.org/documentation/tutor...to-work-in-v156.html )

An Apple a days keeps the doctor away

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

More
3 years 11 months ago - 3 years 11 months ago #78597 by ggppdk
Hello

your code for creating field's HTML display looks proper

add this to your template to make sure that the field has values
Code:
print_r($item->fieldvalues[57]);

replace 57 with your field id
- does it show any values ?

Also test this
Code:
print_r($item->fields['slideshow-link']->label);
- does it show field label ?


-- 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: 3 years 11 months ago by ggppdk.

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.596 seconds
Save
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