Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Including article body inside another article
OK, I’ve just wrote some code that does exactly what you’ve asked.
Welcome here: Inspired.Kiev.Ua: ied_doArticle Textpattern plugin
Plugin Composer — admin plugin to write your own plugins
Offline
Re: Including article body inside another article
Wow! Inspired. And all in 14 lines of code. I’m speechless. This opens up a host of new possibilities. Thank you. Thank you.
Offline
Re: Including article body inside another article
Thank you for your warm words too, Neutrino.
I made a little update to the plugin, so now you can specify more than one id and the plugin will choose one randomly — must be very handy for random quotes.
Plugin Composer — admin plugin to write your own plugins
Offline
Re: Including article body inside another article
Question . . . can doArticle be used like an article or article custom tag, supporting sections, sortdir, etc?
I just upgraded to textpattern 4.0.3 from 4.0.1, and the article containing output_form that was calling a form with article_custom tags BROKE, so i’m back to square 1 (L71).
I’m consideringh the CSS positioning idea, but I don’t think it’s going to work (the page, for anyone interested, is http://www.artandculturecenter.org/teacher-resources – the listings belong under “upcoming” and “past”). The next best idea is to move the lists to a custom article page, but THEN they have to be at the top of the article, before the text, which is a drag…
any other ideaS?
Yes, I have tried turning it off and on.
Offline
#17 2006-08-22 13:57:44
- filip baraka
- Member
- Registered: 2006-06-05
- Posts: 24
Re: Including article body inside another article
Do you get an extra invalid “</p>” paragraph tag after using do article? all pages that have articles with doArticle don’t validate. Help!
Last edited by filip baraka (2006-08-22 13:59:22)
Offline
#18 2006-08-22 14:25:07
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Including article body inside another article
article_custom should work from an article body in svn, if I remember correctly.
I’m curious: why would you need to put one article inside of another?
Offline
#19 2006-08-22 15:15:25
- filip baraka
- Member
- Registered: 2006-06-05
- Posts: 24
Re: Including article body inside another article
i’m working on a Croatian TouristBoard site (http://sibenikregion.com visit for few days, problems with hosting company and im right now switching to textdrive)
typical article in section destination have; image of destination, short description and a contact for that dest. tourist board, however i have other section where are contact info for hotels, rentals, scuba diving, boat charter and like, and also I have a list of tourist boards, so I don’t want to double the data for sake of mind and easy managing.
Back to plugin: if turn off textille, everything is ok, but ofcourse unformatted
article_custom, any tips for that?
Offline
Re: Including article body inside another article
Mary~ I don’t think it’s worth messing around with subversion (like I’d know how). What I’m doing involves a sub-category type of situation, on a very CMS-oriented (not news or blog or even date-oriented) sort of site, where one article needs to have a list of articles in another section in it. Look here:
http://www.artandculturecenter.org/distance-learning
The workaround is that the article body is part of a custom form which never displays txp:body, but IS allowed to call an txp:article_custom to generate the lists. Works well enough, but i’ll be a happiner camper if the new version allows me to put my article_custom stuff right in another article.
Let’s get recursive.
Yes, I have tried turning it off and on.
Offline
#21 2006-08-23 00:51:05
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Including article body inside another article
I don’t think it’s worth messing around with subversion…
I wasn’t suggesting you should, simply pointing out you’d only need a workaround for a little while.
…where one article needs to have a list of articles in another section in it. Look here…
That’s over-complicating it. All you need to do is call article_custom right after your call to article, in your page.
<txp:article form="my_section_article" />
<txp:article_custom form="the_other_articles" />
?
Offline
Re: Including article body inside another article
This thread came up in my search for something..
Probably this capability became possible after these posts; I remember being able to do this (call other articles from within an article) years back, and double-checked: still easily doable now. (Just call the <txp:article_custom id="X" form="your_form" />
) (Just in case anyone else searches or stumbles on this thread too in the future.)
textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation
Offline
Re: Including article body inside another article
I recently ran into a situation where I needed to include aspects of the next/previous article for navigation on an article page. You can get prev_title
to get the title but I needed the article image as well. I eventually figured out how to use etc_link_to
with this method suggested by etc.
<txp:variable name="more" value='<txp:link_to_prev /><txp:link_to_next />' />
<txp:variable name="prev" value='<txp:link_to_prev />' />
<txp:variable name="next" value='<txp:link_to_next />' />
<div class="post-pagination">
<txp:if_variable name="more" value="">
<txp:else />
<txp:if_variable name="prev" value="">
<txp:else />
<txp:article_custom form="pagination-prev" id='<txp:etc_link_to target="prev" link="0">
<txp:etc_link_id /></txp:etc_link_to>' />
</txp:if_variable>
<txp:if_variable name="next" value="">
<txp:else />
<txp:article_custom form="pagination-next" id='<txp:etc_link_to target="next" link="0">
<txp:etc_link_id /></txp:etc_link_to>' />
</txp:if_variable>
</txp:if_variable>
As Alicson notes above, that lets you display whatever you need.
Offline
Re: Including article body inside another article
::mentally files that one for future reference:: ::would love to +1 / “like” / thumbs-up so many posts in this forum::
textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation
Offline