text field inside description field when using blog template

More
10 years 10 months ago #43911 by kogos
I have already created a text field to include a youtube/vimeo video in articles, by triggering a plugin that will show the video after the article text.
However, i am trying to create a second text field that will show the video image caption before the main article, giving it a "hidden" class to hide it in article view, but show the image in category blog view. It works when i add the image manually, but not when using the new text field i created.

I am using the standard youtube url to set the correct url for the image, and in template manager, i'm putting the field just before the description. The problem is that in category view, the first image from the description is stripped and shown, but there is no actual image there... because the image is before the description...

So, is there any way i can add a custom text field inside the description field, so that video caption is shown inside the description (so it can be stripped in category blog view)???

Thanks in advance for your time.

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

More
10 years 10 months ago #43921 by ggppdk
Hello

this is the implementation of the category layout of blog template.

it is better to create 2 fields (1 for image and 1 for video) and display them before or after description

Regards


-- 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.

More
10 years 10 months ago #43922 by kogos
i have created 2 separate fields, images before description and video after description. In article view it's shown as it's supposed to, but in category blog, image cannot be stripped from the text, since it's not in the description but it's on a div right before the description.

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

More
10 years 10 months ago #43923 by ggppdk
Hello

a simple solution is this:

1. duplicate the blog template and create the 'blog2' template

2. place your image field in the "render only" position so that it gets created but not displayed

3. then
edit the category_items.php
find line:
Code:
echo flexicontent_html::striptagsandcut( $items[$i]->fields['text']->display, $this->params->get('lead_cut_text', 400) ); ... echo flexicontent_html::striptagsandcut( $items[$i]->fields['text']->display, $this->params->get('intro_cut_text', 200) );
and replace it with:
Code:
echo flexicontent_html::striptagsandcut( $items[$i]->fields['my_field_name']->display, $this->params->get('lead_cut_text', 400) ); ... echo flexicontent_html::striptagsandcut( $items[$i]->fields['my_field_name']->display, $this->params->get('intro_cut_text', 200) );


-- 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.

More
10 years 10 months ago #43941 by kogos
is there any way i can set it to look into multiple fields for an image, description coretext and my custom text field for example?

the reason i want to do this is because if i edit category_items.php as you suggested, then image should always be in the custom field. But when there is no video caption but just simple images in the coretext field (description text), category_items will not be able to grab that image, cause it will still be looking in the custom field, which would be empty...

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

More
10 years 10 months ago #43982 by ggppdk
hello

yes you can, in the above code,
instead of:
Code:
$items[$i]->fields['my_field_name']->display

use:
Code:
$items[$i]->fields['my_field_name']->display . $items[$i]->fields['text']->display

-- this way it will look inside an HTML text that is the concatenation of both your custom field and then the description field


-- 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.392 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