Mobile app version of vmapp.org
Login or Join
Margaret670

: Joomla change read more link to blog layout id I have a module with articles created with the displaynews plugin. If I click the read more of the articles they go to the full article. But

@Margaret670

Posted in: #Joomla #Php

I have a module with articles created with the displaynews plugin.
If I click the read more of the articles they go to the full article.
But I want them to go to a category blog layout and scroll to the correct article (using the id).

Any idea how this works? I don't even know how to change the link of the read more..

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Margaret670

1 Comments

Sorted by latest first Latest Oldest Best

 

@Shanna517

Not easy but i hope to give you some good starting points.


Learn about "Template override". It means you can change the HTML output of component without hacking Joomla core code.
Use what learned at 1. so you can put an anchor near every article in your blog layout. Hint: you will have to change file:


/templates/[your template]/html/com_content/category/blog_item.php

If it's not there, create it by copying

/components/com_content/views/category/tmpl/blog_item.php

Let's say the anchor you put near every article is something link

<a id="article_<?php echo $this->item->id" ?>" />



Depending on how displaynews plugin (or module?) is coded, you can use what learned at point 1. or you will have to hack the plugin (or module?) code itself. You can change the readmore link from


index.php?option=com_content&view=article&id=XX

to

index.php?option=com_content&view=category&layout=blog&id=CC#article_XX

where CC is the CATEGORY id, while XX is the ARTICLE id

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme