SEF URLs for custom read more

Joomla (SEF) URLs require to have an item ID in the URL. But how do you know the item ID of a NEW article to which there is no menu link? This is the problem we had with our {$JOOMLA_ARTICLE_LINK} template parameter.

Form2Content provides the option to create links in your article intro to the main article. Think of a read more link around an image in your blog view

Your template code could look like this:

< a href="/{$JOOMLA_ARTICLE_LINK}" >< img src="/" >< /a >

*note the extra spaces to prevent rendering

The problem in a nutshell

F2C creates the Joomla articles (and content) upon saving the submission form. If the {$JOOMLA_ARTICLE_LINK} template parameter is included in the template it is replace with the url to the article index.php?option=com_content&view=article&id=xxx. Since there isn't a known item ID it isn't added.

In Joomla 1.5 this worked fine, even in combination with Form2Content Search, where the search results link directly to the article and where the read more can be created using the above template parameter. But in Joomla 1.7 onwards an item ID is required in the URL otherwise all kind of creative (SEF) URLs are build, resulting in in-active menu items, and modules not showing.

F2C Core SEF plugin

The solution is a Joomla plugin which replaces a tag in the Joomla article with the actual URL based on the Joomla router. Form2Content links all required information for building the URL including the Joomla mechanism for determining the best item ID and URL.

How does it work?

Instead of using the {$JOOMLA_ARTICLE_LINK}, use {$JOOMLA_ARTICLE_LINK_SEF} in your template and install the (FREE) plugin.

So for example:

<a href="/{$JOOMLA_ARTICLE_LINK_SEF}" class="readmore">Read more ... </a>

Will result (in your generated Joomla article) like this:

<a href="/{plgContentF2cSef}" class="readmore">Read more ... </a>

Using absolute or relative URLs is both fine, in this case our editor adds the root.

When you parse (view) the article on your website the F2C SEF plugin will render the correct URL, which is converted to a SEF URL if SEF is enabled and everybody is happy!

<< Download F2C Core SEF plugin >>

F2C Cheat-sheet

An overview of all template parameters (placeholders for your form data). These are used in your F2C intro and main template to parse the data from your submission forms into the Joomla article.



Form2Content, a Joomla CCK Documentation © 2010 - 2015 Open Source Design | Powered by Form2Content