Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Substituting article body's content into various parts of the page
Hello,
My current project has a kind of need where the information that I am going to put in the article’s body, should be divided and sent to various small parts of the webpage.
For example,
If its a real estate website, and we are writing an article about an individual property.
We’ll post article images which will go to the slideshow, the excerpt will go to the intro and the body will go to the main information about that property. But I need to post some more information like property’s contact details, pricing, location etc.
I am not really sure how I am going to post it. Since Contact details, pricing, location will come inside the sidebar, I need to have a way to provide my client some ready made field, where he/she can put the information.
In short, there has to be some kind of “custom dedicated fields”(not the one present in Textpattern I am talking about here) where, the entered data will go to the assigned fields, where ever they are called.
I’m a new to Textpattern, so if you know a way to get this done or a plugin that can help me, kindly let me know.
Thanks for your time.
Offline
#2 2012-02-22 15:43:54
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,315
Re: Substituting article body's content into various parts of the page
vineonardo wrote:
Since Contact details, pricing, location will come inside the sidebar, I need to have a way to provide my client some ready made field, where he/she can put the information.
That’s exactly what custom fields are made for, why don’t you want to use them? Or is this below referring to something I’m simply not getting?
not the one present in Textpattern I am talking about here
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: Substituting article body's content into various parts of the page
uli wrote:
vineonardo wrote:
Since Contact details, pricing, location will come inside the sidebar, I need to have a way to provide my client some ready made field, where he/she can put the information.
That’s exactly what custom fields are made for, why don’t you want to use them? Or is this below referring to something I’m simply not getting?
not the one present in Textpattern I am talking about here
Thanks Uli for your reply.
I’m new to Textpattern, as I said before :p
Custom fields are still blur to me. At the moment, all I understand about the custom fields is, they help us to relate articles with eachother using the similar custom fields.
If you think that custom fields can help me accomplish my requirements, kindly guide me if possible.
Thanks again!
Offline
Re: Substituting article body's content into various parts of the page
they help us to relate articles with eachother using the similar custom fields.
I think that definition is too vague. Here is a definition that may help you: “They help us to add extra information to each article.”
So, if I create three custom fields: contact_details, price, location, then I can display those alongside the article:
<aside>
<p class="price">Price: <txp:custom_field name="price" /></p>
</aside>
But in case there is no price provided in an article, you can do this (smarter):
<aside>
<txp:if_custom_field name="price">
<p class="price">Price: <txp:custom_field name="price" /></p>
</txp:if_custom_field>
</aside>
So that will only display “Price:” if there is a price to show. Otherwise, nothing.
Does that help?
Last edited by maruchan (2012-02-22 17:57:34)
Offline
Re: Substituting article body's content into various parts of the page
The wiki should help get you started.
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Offline
Re: Substituting article body's content into various parts of the page
Hi Vineonardo
You probably need one custom field called property_id.
You could then create three or four posts per property.
1. Title and brief description.
2. Images
3. Detailed description.
4. Summary description
Then use your custom field as part of article_custom to output the relevent articles in sequence.
You need to use CSS to make them look like one article.
Geoff
Last edited by geoff777 (2012-02-24 19:44:47)
There are 10 types of people in the world: those who understand binary, and those who don’t.
Offline
Re: Substituting article body's content into various parts of the page
@geoff777
Thanks for the tip.
I’m sure gonna try that :)
It also seems efficient considering we just have 10 custom fields.
Right now, I am using four custom fields for Property area, location, availability & price.
But your tip seems much easier & flexible.
Thanks again! :)
Offline
Re: Substituting article body's content into various parts of the page
vineonardo wrote:
considering we just have 10 custom fields.
If you run out of CFs or want more than just boring text fields for each article, there’s always glz_custom_fields. It’s not a free plugin but the modest donation does get you updates for life for any domain, and it’s worth every penny imo.
Last edited by Bloke (2012-02-26 10:55:39)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline