Include Content Item plugin |
| Written by kksou | ||||
| Monday, 05 May 2008 | ||||
|
This plugin allows you to insert or include one content item into another content item. Inserting a content item is as simple as {include_content_item 123}, This is useful, for example, when you have a block of text that you want to appear across a number of articles or content items e.g. download instructions, copyright notice, images, common links/resources, etc. Available for all Joomla versions: Joomla 1.0.x, native 1.5.x, 1.6.x and 1.7.x! The latest version now supports nested include! Details here, Latest Version v1.0.11 (for Joomla 1.0), v1.5.11 (for Joomla 1.5), v1.6.11 (for Joomla 1.6), v1.7.11 (for Joomla 1.7), v2.5.11 (for Joomla 2.5) Yes, native version of the plugin for Joomla 2.5 is now available! How to use the "Include Content Item" plugin
Displaying the Read More linkThere are several options to display the Read More link:
{include_content_item 123 readmore=1}
the intro text will be displayed, followed by the default "Read More" as defined by your template. Note that if there is no text in the main text, there will be no "Read More" link displayed. {include_content_item 123 readmore='[Read More]'}
Important: Please make sure you put single quotation marks surrounding the text. {include_content_item 123 readmore='View Full Article...' class=style1}
{include_content_item 123 readmore_gif='/url/of/your/image/file'}
Important: Please make sure you put single quotation marks surrounding the url of the image file. Although it says "readmore_gif", you can use any browser supported image format such as jpg or png. You can also add the parameter align=top, align=middle or align=bottom to align the image: {include_content_item 123 readmore_gif='/url/of/your/image/file' align=top}
{include_content_item 123 readmore_gif='/url/of/your/image/file' br_before=1}
Nested IncludeThe Include_Content_Item plugin now supports nested include! That is, if you have article A that includes article B, which has a include of article C, both B and C will now be included in A.
{include_content_item 123 readmore=1 nested=0}
{include_content_item 123 readmore=1 level=2}
Allow Multiple Includes of the Same ArticleThe Include_Content_Item plugin now allows you to include the same article for more than once. In the previous version, by default, an article will be allowed to include only ONCE per article. With this version, to include, say article id 123, 3 times in the same article, use the following:
{include_content_item 123}
{include_content_item 123 allow_multiple=1}
{include_content_item 123 allow_multiple=1}
Note the use of the flag allow_multiple=1 for the 2nd and 3rd time - otherwise these 2 tags will be ignored. Display of Fulltext using Fade-inIf you use the default Joomla "Read More" link, when the user clicks on the link, Joomla will divert the user away from the current page and display the full article. If you would like the user to stay on the same page, use the fade-in option. When the user clicks on the "Read More" link, the fulltext (or maintext) will be displayed as fade-in right inside the same page (without any reloading of page).
{include_content_item 123 readmore=1 fadein=1}
There are three ways to display the fadein:
Sample 1: Click the ReadMore link to display the full article...
[Read more...] You are now viewing the "fulltext" portion of the article. Here's the tag for this this one:
You can set the text label for the ReadMore links, for example, you might want to set this to your own language. Note that you need to define the text labels for both the show and hide link. The text labels are delimited by '|' (the vertical bar). Please also enclose these in single quotes (NOT double qutoes).
Sample 2: Click the ReadMore link to display the full article...
Your ReadMore Link >>> You are now viewing the "fulltext" portion of the article. Here's the tag for this this one:
To use your own style for the ReadMore link, use the following. Don't forget to define the style
{include_content_item 123 readmore='Your ReadMore Link >>>|Your HideDetails Link >>>'
Sample 3: Click the ReadMore image link to display the full article... ![]() You are now viewing the "fulltext" portion of the article. Here's the tag for this this one:
To use your own style for the ReadMore image link, use the following. Don't forget to define the style
{include_content_item 123 readmore_gif='url_of_showmore.jpg|url_of_hidetails.jpg'
Sample 4: Click the ReadMore button to display the full article... You are now viewing the "fulltext" portion of the article. Here's the tag for this this one:
As in text link, you can set the text label for the ReadMore/Hide buttons: Sample 5: Click the ReadMore button to display the full article... You are now viewing the "fulltext" portion of the article. Here's the tag for this this one:
Include Content Item moduleIf you wish to include a content item into a module (as oppose to another content item), use the following module which I've written: Include Content Item Module. Include a content item into another content item => use this plugin. Include a content item into another module => use the Include Content Item Module. Be a SponsorIf you find this plugin useful, Secure Payments by PayPal. DownloadJoomla 1.0.x: include_content_item_v1.0.11.zip
Joomla 1.5.x: include_content_item_v1.5.11.zip Joomla 1.6.x: include_content_item_v1.6.11.zip Joomla 1.7.x: include_content_item_v1.7.11.zip Joomla 2.5.x: include_content_item_v2.5.11.zip How to install (Joomla 1.0.x)
How to install (Joomla 1.5.x)
Version History
Released July 23, 2008 This is an enhancement contributed by Aleksandar Bogdanovic. Parameter #1: id of the content/article to be included Released July 31, 2008 This is an enhancement requested by Denis. New features: This is an enhancement contributed by Dr. J.R.Halon. The "Include Content Item" plugin now works with Joom!Fish! (a multilingual content manager for Joomla) New features: This is an enhancement requested by Rexkramer. The "Include Content Item" plugin now allows you to display the "Read More" link. Please refer to here for details of how to display the "Read More" link. Yes, the plugin now supports nested include! Please refer to here for more details. Added fadein of fulltext FAQ (Frequently Asked Questions)Q1: I want to include a content item into a module (as oppose to another content item). What should I do? A1: Use the following module which I've written: Include Content Item Module. |
||||
| < Prev | Next > |
|---|






Comments
I would like to display the article in my content and hide it with 'readmore':
{include_conten t_item 123 readmore=1 fadein=1}
But the article is always shown and no 'read more' link is displayed.
Please help!
Have you tried this on a fresh install of Joomla 2.5 using standard Joomla template?
It might be a conflict with your Joomla template or other plugins/modules. Conflicts between different pluginsm modules and templates are very common in Joomla.
Can you email me the URL of your page so that I can do a view source to gather more clues as to where might be the problem.
Regards,
/kksou
I have not installed any other plugins, because I'm still at the beginning of the development of my website.
The website is only on my local webserver.
Have you testet the plugin with joomla 2.5?
Thank you for your help.
By the way, in the Joomla editor, did you tell Joomla which portion belongs to the intro and which is the rest of the article? Did you click the "Read More" button at the bottom of the editor to add a "red dotted line" across your article?
Regards,
/kksou
The "Read More" Link now is shown.
But...When I click the "Read More..."-link, the article opens as new site. The fade in doesn't work.
What should I do? Any idea?
Thanks!
No. This plugin only displays the content of another article. It does not allow you to edit the content.
Regards,
/kksou
The component of weblinks which is included by was not available.what was the syntax?
I've done with following:
{include_conten t_item 1 readmore=1 fadein=1}
or
{index.php?option=com_weblinks&view=weblink&layout=view&id=1}
What's wrong with me?
Please just try {include_conten t_item 123}
where 123 is the ID of the article you want to include.
For your 2 tags above,
1) This is ok if article ID 1 is the one you want to include. For testing purpose, would suggest you don't include readmore=1 and fadein=1 first. Just use {include_conten t_item 1} and see if it works. If it works, then add in readmore=1. If it still works, then add in fadein=1. This will allow you to find out which part is the one giving problem.
2) Please take a look at the sample tags on this page. There's no tags like this.
Please give it a try one more time and let me know what you see on the screen.
Regards,
/kksou
{include_weblin ks_item 1}
this does not work.
And I am using under J!2.5.3.
Would be the thing around SEO??? Joomla automatically remove the url to the native language. hmm...
1) You wrote {include_weblin ks_item 1}
It should be {include_conten t_item 1}
unless you are using other plugins.
2) Please log on to your backend as administrator. Go to Article Manager. Please check there's indeed an article of ID=1. It could be that there's no article of ID=1.
Regards,
/kksou
2)Article and Weblink had an ID of 1 each other...
Also, can you give me the URL of the article 1 that you refer to? Just want to do a view source to get more clues as to where might be the problem.
Regards,
/kksou
include
an article component
index.php?option=com_content&view=article&layout=edit&id=1
The url of frontend has renamed by alias. I just would like to include from the weblinks component to the Article component.
The "Include Content Item" plugin allows you to include one Joomla article into another Joomla article - both are Joomla articles.
A content plugin will not work with the weblinks component. It's designed to be use within Joomla articles only.
Regards,
/kksou
Regards,
/kksou
Is it possible that the plugin show only articles published and not display the articles expired or pending?
Thank you for your answer.
Quoting soscar:
For those questions that I have the answers, I will always reply immediately.
For your case, I didn't reply because I really don't know how to help you.
If you take a look at the history, starting from v1.5.10 (for Joomla 1.5), the article will only be included if it is published. If you unpublish the included article, the article will NOT be displayed.
I've just tested the plugin again. It does indeed test for whether an article is published or not. If it's not published, the article will not be included.
I do not have access to your backend. There's no way I can do any debugging. That's why I didn't reply anything...
Regards,
/kksou
thanks for your clear answer. I know that the plugin works well when an article is published. The problem is that Joomla has MORE STATES than published or unpublished. Are EXPIRED or PENDING and not displaying them, Joomla works fine but the plugin does display and that's not right.
You can do a test by changing the dates on an article to expire.
Regards
Yes, the current version of the include content item tests for only the status of published and unpublished. It tested no other fields. I thought by right when your article is in the EXPIRED or PENDING mode, the Joomla system should automatically set it to be in the unpublished mode (it makes sense, right), but apparently this is not the case.
This plugin has been released for almost 4 years. And you are the first one with this request!
If you have used some of my other plugins, you would know that most of my plugins are light-weight plugins. I prefer simplicity and less codes (e.g. the googleMaps plugin). There are many other competing plugins out there with a lot more features - but heavier codes and usually more difficult to use.
Do you know a bit of PHP? If yes, you can modify the code to test the articles for EXPIRED or PENDING. Let me know if you need any help in this and I'll see what I can do.
Regards,
/kksou
I made ??the modifications to check dates and control articles expired or pending. If you want, I put it them here. Not pose much overload code.
Regards
That's great!
If you're willing to share with others, please email me your modified codes. I will incorporate your codes into the new version - and make any modification so that it will work with all versions of Joomla (Joomla 1.0, 1.5, 2.5, etc.)
Warm Regards,
/kksou
tell me your email address and I will be happy to send it.
I take this opportunity to say that this plugin is very useful for me.
Thank you very much
Quoting kksou:
Is there a way that I can modify the plug-in so that other content plugins in the linked article are called?
RSS feed for comments to this post