1

I'm trying to make the string $url from article.php, which contains the link to the full article in Joomla, available to make custom readmore links in my articles.

To be exactly clear: I want to use the code <a href="<?php echo $url; ?>">Readmore</a> in my articles when I edit them in the Joomla Backend / Content / Articles / Edit Article.

Maybe somebody has an idea here. I already tried the DirectPHP Plugin but I didn't have any luck with it so far.

1

2 Answers 2

2

By default, PHP code is stripped from article content when saving.

DirectPHP and similar extensions enable you to include PHP code in your articles without the code being stripped by your editor when saving the article.

Remember to enable the plugin in Extensions -> Plugins.

If DirectPHP isn't working for you, I suggest trying an alternative such as Regular Labs Sourcerer.

Remember to enable the plugin in Extensions -> Plugins after installation and then add your code to your article like this:

{source}
  <?php
    echo $url;
  ?>
{/source}
0

Did you try use JCE Editor and use "read more" link ?

Its free:

https://www.joomlacontenteditor.net

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.