Custom Blog files not rendering when using module categories Topic is solved
Moderators: pe7er, 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.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
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.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
-
- Joomla! Apprentice
- Posts: 7
- Joined: Thu Aug 25, 2016 11:28 am
Custom Blog files not rendering when using module categories
Good day everyone,
I have made a copy of Articles Blog, renamed files and edited XML file and all is working
Files location: templates/MyTemplate/HTML/com_content/category/my-files
I have set up a menu item and have my custom Blog showing on the page
On the same page I have a categories module to filter items
My problem comes when I click a category, and display the items.
Instead of categories using the modified override files, I see it using blog.php from components, so my modifications are not rendered and the modified blog files are not used in this instance.
How do I make categories module use my modified Articles Blog override files instead of using default Article Blog files?
Thank you for any help here, this behaviour has got me!
PS, loving the new Joomla 4
I have made a copy of Articles Blog, renamed files and edited XML file and all is working
Files location: templates/MyTemplate/HTML/com_content/category/my-files
I have set up a menu item and have my custom Blog showing on the page
On the same page I have a categories module to filter items
My problem comes when I click a category, and display the items.
Instead of categories using the modified override files, I see it using blog.php from components, so my modifications are not rendered and the modified blog files are not used in this instance.
How do I make categories module use my modified Articles Blog override files instead of using default Article Blog files?
Thank you for any help here, this behaviour has got me!
PS, loving the new Joomla 4
- toivo
- Joomla! Master
- Posts: 17467
- Joined: Thu Feb 15, 2007 5:48 am
- Location: Sydney, Australia
Re: Custom Blog files not rendering when using module categories
The name of the override folder is html, not HTML.
Toivo Talikka, Global Moderator
- AMurray
- Joomla! Exemplar
- Posts: 9787
- Joined: Sat Feb 13, 2010 7:35 am
- Location: Australia
Re: Custom Blog files not rendering when using module categories
To clarify, toivo means *lowercase* html, not uppercase HTML (particularly relevant to Linux-based servers.
Regards - A Murray
General Support Moderator
General Support Moderator
-
- Joomla! Apprentice
- Posts: 7
- Joined: Thu Aug 25, 2016 11:28 am
-
- Joomla! Apprentice
- Posts: 7
- Joined: Thu Aug 25, 2016 11:28 am
Re: Custom Blog files not rendering when using module categories
Is this categories module behaviour expected or unexpected on an Article:blog page?
This would apply if someone could replicate the behaviour on J4.
Maybe it is a code bug if verified?
I am not a coder, more a tinkerer so bear with me please.
I am trying to follow instructions in the book: Developing Extensions for Joomla! 5, I am trying to gain a better understanding of J4/J5.
This would apply if someone could replicate the behaviour on J4.
Maybe it is a code bug if verified?
I am not a coder, more a tinkerer so bear with me please.
I am trying to follow instructions in the book: Developing Extensions for Joomla! 5, I am trying to gain a better understanding of J4/J5.
- toivo
- Joomla! Master
- Posts: 17467
- Joined: Thu Feb 15, 2007 5:48 am
- Location: Sydney, Australia
Re: Custom Blog files not rendering when using module categories
Did you create an override for the Categories module, mod_articles_categories or mod_articles_category? Those modules work independently of the component.
Toivo Talikka, Global Moderator
-
- Joomla! Apprentice
- Posts: 7
- Joined: Thu Aug 25, 2016 11:28 am
Re: Custom Blog files not rendering when using module categories
Thank you toivo,
to double check I recreated these steps on my website this morning as to rule out a simple mistake.
blog.php
blog.xml
blog_children.php
blog_links.php
blog_item.php
The above were all copied from 'components/com_content/tmpl/category' ;renamed with a prefix 'custom-' and placed into
templates/MyTemplate/html/com_content/category
in the XML file these lines were altered to
<layout title="custom-blog" option="custom-blog">
<message>
<![CDATA[A custom blog]]>
I have not made override changes to Categories module, mod_articles_categories or mod_articles_category
I just discovered in my case that the categories module when placed on the same page as the custom_blog forgot I was using an override and custom blog and used the blog.php in components/category.
The only solution I have at the moment is not to use the categories module with an override of this type.
I do not understand enough about Joomla 4 to resolve this.
Once again, thank you for replying.
- toivo
- Joomla! Master
- Posts: 17467
- Joined: Thu Feb 15, 2007 5:48 am
- Location: Sydney, Australia
Re: Custom Blog files not rendering when using module categories
That would not have worked. The override files need to have the same name as the original files.ThorHammer wrote: ↑Wed Apr 10, 2024 11:14 amThe above were all copied from 'components/com_content/tmpl/category' ;renamed with a prefix 'custom-' and placed into
templates/MyTemplate/html/com_content/category
There is no need to create overrides manually. Follow this tutorial: Joomla 4.x: Template Overrides. Please note that when several files are copied into a subfolder of the html folder but only one of those files is modified, the other files can be deleted. That keeps the override structure as simple as possible for future maintenance and possible refactoring.
Toivo Talikka, Global Moderator
-
- Joomla! Apprentice
- Posts: 7
- Joined: Thu Aug 25, 2016 11:28 am
Re: Custom Blog files not rendering when using module categories
Thank you,toivo wrote: ↑Wed Apr 10, 2024 10:46 pm
There is no need to create overrides manually. Follow this tutorial: Joomla 4.x: Template Overrides. Please note that when several files are copied into a subfolder of the html folder but only one of those files is modified, the other files can be deleted. That keeps the override structure as simple as possible for future maintenance and possible refactoring.
This is the tutorial I was following to get me this far
https://www.joomlashack.com/blog/joomla ... ry-layout/
also this
https://github.com/brianteeman/joomla-cards
From your reply I am assuming the above is most probably a hack rather than a supported method, and I'm probably walking with crutches following it, just as I ditched one crutch nearing success I had the issues and needed a wheelchair instead.
I will read the template overrides and rethink my methods to achieve a card layout for one page of the many Article type Blog pages on my project.
Maybe using CSS overrides along with 'display: none' to hide the intro text and core features like columns would be a better strategy.
I really appreciate the help, you have saved me time by abandoning the tutorial and code snippet I was using to guide me.
-
- Joomla! Hero
- Posts: 2924
- Joined: Fri Jul 05, 2013 10:35 am
- Location: Parts Unknown
Re: Custom Blog files not rendering when using module categories
That tutorial is not wrong. But perhaps you have multiple category menu items and the module simply links to the one using the default layout.
-
- Joomla! Apprentice
- Posts: 7
- Joined: Thu Aug 25, 2016 11:28 am
Re: Custom Blog files not rendering when using module categories
I really don't know, I have now abandoned this attempt for the time being, I am now using an override Article Blog with some conditional statements.
I used $this->params->get('blog_class') to retrieve parameters i entered at Blog->Article Class and was able to implement my changes.
I did discover this which may be of help to anyone trying Overrides and Alternative Menu Items after I had implemented my changes
https://docs.joomla.org/J4.x:Template_Layouts
I may revisit this at a later date as it's irking me, but for the time being the show must go on, and I have achieved the desired changes.
Everyone has been so helpful, thank you.