suggestion to joomla - category & articles Class Suffixes

Need help with the Administration of your Joomla! 3.x site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Post Reply
sofian10
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Sat Dec 24, 2016 9:26 am

suggestion to joomla - category & articles Class Suffixes

Post by sofian10 » Thu Jan 10, 2019 2:36 pm

hi
it will be graete if adding an option "Class Suffixes" to category include it's articles .
then we can design a group of articles in single category .

is this possible ?

thanks

waarnemer
Joomla! Hero
Joomla! Hero
Posts: 2157
Joined: Sun May 04, 2008 12:37 pm

Re: suggestion to joomla - category & articles Class Suffixes

Post by waarnemer » Fri Jan 11, 2019 9:17 am

Template overrides will do it... but XML files are excluded by default from overrides.. though it is possible.

First option.
I am doing this on this old site: cadet2017.com
using this plugin: https://extensions.joomla.org/extension ... -override/
I added two fields. This allowed me to add a class to assign colours to the headers of the categories (and an optional icon).
It will require some coding. You need to recreate your xml and also create an override to the article/category views in your template.


Second option.
Use the core "custom fields" feature. But I found that somewhat confusing as it stored the field values in another table. I have more than just j! relying on that information.. ;)
Also the new values are on another added tab in the manager. I wanted it on an already existing tab for my authors. It still will require you to make template overrides...
But if you want to stay clear from added extensions, use the core "custom fields".

Warning... first option may not be safe when upgrading to a future 4.x release...

sofian10
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Sat Dec 24, 2016 9:26 am

Re: suggestion to joomla - category & articles Class Suffixes

Post by sofian10 » Fri Jan 11, 2019 5:53 pm

you said 2 things :
waarnemer wrote:
Fri Jan 11, 2019 9:17 am
It will require some coding.

Warning... first option may not be safe when upgrading to a future 4.x release...
i am a man that not understand any things in php ,js and jquery .
but i love css and it easy for me .
there are many people like me .
i can't coding but can make beautiful results by css .

beleave me , if there is a "Class Suffixes" in menu add/edit that works on every item under this menu ,
it will be fantastic .
the menu has "Class Suffixes" just for it's link only .

big thanks for this help .

annahersh
Joomla! Guru
Joomla! Guru
Posts: 557
Joined: Wed Aug 15, 2018 8:23 pm

Re: suggestion to joomla - category & articles Class Suffixes

Post by annahersh » Fri Jan 11, 2019 6:36 pm

sofian10 wrote:
Thu Jan 10, 2019 2:36 pm
hi
it will be graete if adding an option "Class Suffixes" to category include it's articles .
then we can design a group of articles in single category .

is this possible ?
It is certainly possible. I use this method for maximum control. You'll need to create override content and layout files, then create a supporting plugin that will create the fields and assign the classes to the body tag.
category-class.jpg
article-class.jpg
You do not have the required permissions to view the files attached to this post.

sofian10
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Sat Dec 24, 2016 9:26 am

Re: suggestion to joomla - category & articles Class Suffixes

Post by sofian10 » Fri Jan 11, 2019 7:41 pm

annahersh wrote:
Fri Jan 11, 2019 6:36 pm
It is certainly possible. I use this method for maximum control. You'll need to create override content and layout files, then create a supporting plugin that will create the fields and assign the classes to the body tag.
category-class.jpg
article-class.jpg
i can't create this plugin .i dont know create/edit php & js .
thanks

sofian10
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Sat Dec 24, 2016 9:26 am

Re: suggestion to joomla - category & articles Class Suffixes

Post by sofian10 » Sat Jan 12, 2019 4:07 am

in fact , there is already this option on menu mannager .
in PAGE DISPLAY tab > PAGE CLASS .
this add class to body and content .
i did not see it before .

thanks

annahersh
Joomla! Guru
Joomla! Guru
Posts: 557
Joined: Wed Aug 15, 2018 8:23 pm

Re: suggestion to joomla - category & articles Class Suffixes

Post by annahersh » Sat Jan 12, 2019 5:09 am

sofian10 wrote:
Sat Jan 12, 2019 4:07 am
in fact , there is already this option on menu mannager .
in PAGE DISPLAY tab > PAGE CLASS .
this add class to body and content .
i did not see it before.
Yes that method has existed since Joomla 1.5, and it works for pages or category with an assigned menu item, and unless your template has a method to grab the pageclass and add it to the body or html tag, the CSS styling will only affect the article wrapper.

Your interest was to be able to add class to individual articles, and it's an excellent suggestion. Maybe it will be available in the core of J4.0.

sofian10
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Sat Dec 24, 2016 9:26 am

Re: suggestion to joomla - category & articles Class Suffixes

Post by sofian10 » Sat Jan 12, 2019 9:20 am

annahersh wrote:
Sat Jan 12, 2019 5:09 am

Yes that method has existed since Joomla 1.5, and it works for pages or category with an assigned menu item, and unless your template has a method to grab the pageclass and add it to the body or html tag, the CSS styling will only affect the article wrapper.

Your interest was to be able to add class to individual articles, and it's an excellent suggestion. Maybe it will be available in the core of J4.0.
it is yes add class to individual articles .
i test it , the class added to html wrapper and content div .
this mean if the menu is category blog , the class will works on all articles links (intro image+title+intro text ....)
then if click to open article the class is there too .
i can desine what i want under this class menu .
now i have an easy life .

thanks for all help and replys .

Image

annahersh
Joomla! Guru
Joomla! Guru
Posts: 557
Joined: Wed Aug 15, 2018 8:23 pm

Re: suggestion to joomla - category & articles Class Suffixes

Post by annahersh » Sat Jan 12, 2019 9:40 am

As stated in the reply: and unless your template has a method to grab the pageclass and add it to the body or html tag

The class is not being inserted to the html and body tags by the core Joomla system. That's all being done by the T3 framework. Switch to the default Protostar template and check the source.

sofian10
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Sat Dec 24, 2016 9:26 am

Re: suggestion to joomla - category & articles Class Suffixes

Post by sofian10 » Sat Jan 12, 2019 9:45 am

annahersh wrote:
Sat Jan 12, 2019 9:40 am
The class is not being inserted to the html and body tags by the core Joomla system.
you are right
i learned a new thing .

very thanks

User avatar
leolam
Joomla! Master
Joomla! Master
Posts: 19529
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ UK/ S'pore/Jakarta/ North America
Contact:

Re: suggestion to joomla - category & articles Class Suffixes

Post by leolam » Sun Jan 13, 2019 3:19 pm

annahersh wrote:
Sat Jan 12, 2019 5:09 am
Maybe it will be available in the core of J4.0.
not at present

Leo 8)
Joomla's #1 Professional Support Provider:
-> Joomla Professional Support: https://gws-desk.com -
-> Joomla Specialized Hosting Solutions: https://gws-host.com -
-> Joomla Webmaster Services: gws-webmaster.services

User avatar
leolam
Joomla! Master
Joomla! Master
Posts: 19529
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ UK/ S'pore/Jakarta/ North America
Contact:

Re: suggestion to joomla - category & articles Class Suffixes

Post by leolam » Sun Jan 13, 2019 3:24 pm

@Sofian10. Have a look at SP Pagebuilder Pro or Yootheme Pro or the GAntry Framework (free). All do what you want to achieve. http://gantry.org (created by Rockettheme.com)

Leo 8)
Joomla's #1 Professional Support Provider:
-> Joomla Professional Support: https://gws-desk.com -
-> Joomla Specialized Hosting Solutions: https://gws-host.com -
-> Joomla Webmaster Services: gws-webmaster.services


Post Reply

Return to “Administration Joomla! 3.x”