How to copy and customize files of FLEXIcontent template

More
9 years 4 months ago - 9 years 4 months ago #55939 by Arno
Hi,

I'm trying to customize the layout of a template I'm using (blog template) in both item and category views.
For some reason (that I can't really understand…) it seems that this template is not that… flexible !

In my case, I'd like the images of my article to show first, then the title and after that, the tags.

So here is what I've done :

I went to site/components/com_flexicontent/templates/blog/
and copied those files :
category_items_html5.php
item_html5.php
and pasted those copies in
site/templates/mytemplate/html/com_flexicontent/templates/blog

So that I can work on these files and override the original files.

Can someone confirm this is the right way ?

Then, within the code, I tried to target the several elements I need to modify in these php files.
Which is not easy for me cause I'm not that familiar with php.

My actual problem is in the item_html5.php file. I can't find a way to separate the image and the tags.
I think that both the image and the tags are treated in the following paragraph :
Code:
<?php if (isset($item->positions['beforedescription'])) : ?> <!-- BOF beforedescription block --> <div class="customblock beforedescription group"> <?php foreach ($item->positions['beforedescription'] as $field) : ?> <span class="element <?php echo $columnmode; ?>"> <?php if ($field->label) : ?> <span class="flexi label field_<?php echo $field->name; ?>"><?php echo $field->label; ?></span> <?php endif; ?> <span class="flexi value field_<?php echo $field->name; ?><?php echo !$field->label ? ' nolabel ' : ''; ?>"><?php echo $field->display; ?></span> </span> <?php endforeach; ?> </div> <!-- EOF beforedescription block --> <?php endif; ?>

Can someone tell me how to treat the image and the tags separately, starting from here ?
This would be highly appreciated ! :-)
Last edit: 9 years 4 months ago by ggppdk.

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

More
9 years 4 months ago - 9 years 4 months ago #55946 by ggppdk
Hello

you do not need to copy these manually

- go to flexicontent backend "templates" manager
and click to duplicate the 'blog' template as blog2

the folder
site/components/com_flexicontent/templates/blog/

will be copied as:
site/components/com_flexicontent/templates/blog2/

then you can edit via an editor or via our layout editor


-- 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: 9 years 4 months ago by ggppdk.

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

More
9 years 4 months ago #55949 by Arno
Thank you for your answer.

Actually, I made my explanation a little simplier than the "concrete" situation.
Since I'm already working with a copy of the blog template.
I'm even ONLY working with template copies and not the default ones.

So you're right, I do not need to override those files which are already copies :-)
I only wanted to be cautious, maybe too much !
Just being curious : is overriding decreasing performances ? In other words, would the pages appear faster if I was customizing directly the template files ? Or is it coming to the same result ?

Any idea about my php question ?
Since I worked a little more on this, I'm starting to think I can't deal with tags and image separately, cause all fields seem to be treated together, according to one position.
And since there are not so many positions available in the blog template…
Am I right ?

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

More
9 years 4 months ago #55960 by Rooney
Hi,
if you set you customized template for example in category settings only this template is used and not the standard one.
Also, performance depends on what code you are using in your custom template. I for example deleted every line of code and php functions that is not needed (e.g. voting or date or author or tags or print function).
Rooney

Joomla! 3.9.24 and FC 3.3.9

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

More
9 years 4 months ago #55964 by Arno
Thank you Rooney for your answer.

Actually, my "performances" question was not exactly about using some default template or not, but about using an override of this template.

Deleting useless lines sounds like a good idea to me. But, once again, I'm afraid my php knowledge is too small for that.
But I might try this someday :-)

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

More
9 years 4 months ago #55965 by Rooney
If you copy a template and use it without any changes than you have the same 'performance'. Depending on what you change (adding functions or deleting functions, adding code or deleting code) the performance will change respectively! A FlexiContent template is like a Joomla template. It is kind of an add on that gives you the additional features like custom fields display.
Rooney

Joomla! 3.9.24 and FC 3.3.9

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

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