This could be done using the HTML override technique. The following documents would be of help in understanding the output override technique. Even though some of the documents may not be for the latest version of Joomla, the concept is equally good for all versions of Joomla.
https://docs.joomla.org/Understanding_Output_Overrides
https://docs.joomla.org/J4.x:Template_Overrides
As you are referring to the Blog layout, the file to override would be blog.php that is located in the directory \components\com_content\tmpl\category.
Within the code where the class is defined/coded, you could use article id with some prefix (eg article-x where x is the ID of the article) and make it as an additional class. This will be distinct for each article irrespective of their position. The following image will demonstrate this approach.
Another way would be to have a variable and increment it and using the variable's value with some prefix to create class name.
https://docs.joomla.org/Understanding_Output_Overrides
https://docs.joomla.org/J4.x:Template_Overrides
As you are referring to the Blog layout, the file to override would be blog.php that is located in the directory \components\com_content\tmpl\category.
Within the code where the class is defined/coded, you could use article id with some prefix (eg article-x where x is the ID of the article) and make it as an additional class. This will be distinct for each article irrespective of their position. The following image will demonstrate this approach.
Another way would be to have a variable and increment it and using the variable's value with some prefix to create class name.
Statistics: Posted by imanickam — Sat Aug 17, 2024 5:17 am