Friday, 11 June 2021
  4 Replies
  4.6K Visits
0
Votes
Undo
  Subscribe
Hello, thank you for the great job. Within an 'articles by category module' I would like to hide/show the custom fields (product description) when the user click on a "details' button. can easy layouts do that
This could be done with a UIkit toggle or Bootstrap collapse (see https://getuikit.com/docs/toggle or https://getbootstrap.com/docs/3.3/javascript/#collapse).

If you have difficulties let me know and I'll try to assist you

Review EasyLayouts. If you use EasyLayouts please post a rating and a review at the Joomla! Extensions Directory.
https://extensions.joomla.org/extension/easylayouts/

2 years ago
·
#3250
Hello, thank you jor the answer.
As I am displaying an "articles by category blog" the collapse method works fine with a "details" link for the first article but if the same link appears on the other articles, it opens the custom field layouts in the same first article.
I want the same behavior for each article displayed,of course.
I send images EasyLayouts1.png EasyLayouts2.png EasyLayouts3.png
Thank you for your help, best regards
You need a unique ID in the layout.

So where you have collapseExample you would need to incorporate an item id in some way. This isn't currently possible in EasyLayouts - I'll take a look as see what is possible.

Review EasyLayouts. If you use EasyLayouts please post a rating and a review at the Joomla! Extensions Directory.
https://extensions.joomla.org/extension/easylayouts/

Ok - not so hard

Edit the file administrator/components/com_easylayouts/output/common/custom_field.php and add these new lines

foreach (array("subform_wrappertop", "subform_wrappertop") as $wrapperfield)
{
$field[$wrapperfield] = str_replace("{ID}", isset($item->id) ? $item->id : "", $field[$wrapperfield]);
}


at line 34 just after


$field["subform_wrappertop"] = str_replace('{FIELDNAME}', $heading, $field["subform_wrappertop"]);
$field["subform_wrapperbottom"] = str_replace('{FIELDNAME}', $heading, $field["subform_wrapperbottom"]);



Then change your wrapper HTML use use


collapseExample{ID}



I'll include this change in the next release of EasyLayouts

Review EasyLayouts. If you use EasyLayouts please post a rating and a review at the Joomla! Extensions Directory.
https://extensions.joomla.org/extension/easylayouts/

  • Page :
  • 1
There are no replies made for this post yet.

If you use EasyLayouts please post a rating and a review at the
Joomla! Extensions Directory.