Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
What's the best way to publish the same content with different flavors
Hi,
I’ve set up a simple bookstore with Textpattern, and everything works. I want to extend what I have by offering a more elegant interface for items that are offered in multiple formats. So right now, I would create a separate article for each format, with the same cover image and excerpt appearing several times in the article list view. What I want to do is create one “mother” article that has all the information common to all formats, like the title and cover image, and enter the different formats as “child” articles that link to the mother article and to eachother automatically.
It seems like soo_multidoc is the best way to do this using using Textpattern. Is that correct? Is there another, better way to make this happen? If so, I want to find out before investing too much time or effort in learning and configuring Multidoc, especially if serious problems cropped up with Multidoc that I don’t know about.
Thank you!
Offline
Re: What's the best way to publish the same content with different flavors
Sounds interesting.
When you talk about different formats, can you give us an example so we can better understand what is involved?
As you say that each item shares the same cover and excerpt, would it be possible to set up one master article per item and use a custom field to hold the list of different formats that the item is available in? You could then use either PHP
or a plugin like rah_replace
to iterate over the list of different formats in the custom field to split out the information for display.
Offline
Re: What's the best way to publish the same content with different flavors
If those formats are available for download and have been uploaded via the files tab, you could use a custom field to either:
- hold the linked ID#s of the respective files and use file_download_list to show the formats. You could additionally use file categories to denote the formats, or some php to get the file extension – for example to provide format badges in your overview.
- alternatively create a file category for each book and place all the relevant files in that category, then place that the category-name in the custom field, and use the file category to output your file list. That would also be easily extensible if other file formats were to be added in future.
- If you need to be able to filter your book list to show only what’s available in a particular format, a simple but not terribly beautiful way would be to have several tickbox custom fields for “filename” and “pdf format”, “epub format”, “mobi format” etc. If you name your files identically, you could build your download links based on the combination of ticked boxes and filename. springworks idea with iterating over a list held in a single custom field could work here too.
TXP Builders – finely-crafted code, design and txp
Offline
Re: What's the best way to publish the same content with different flavors
Jeff’s plugins are great, but I don’t think it’s a good idea to create multiple articles for the same content in your case. You could store all flavors in the article body, and extract what needed with etc_query
, see here.
Offline
Re: What's the best way to publish the same content with different flavors
Thank you all! I composed a reply to this last week, but the forum forgot I was logged in and destroyed my message when I clicked “Submit”.
Springworks asked for an example. Here’s a link to the current working version.
Right now, there’s just one publication that’s offered in multiple formats. As you can see, some of the info that the different formats have in common includes the title, description (body), publisher, and authorship info. But the different formats have several fields of information that is independent, including format (natch), price, availability, payment method (we’re currently using Gumroad and PayPal for different offerings), item ID, and ISBN.
We are not currently hosting the file downloads, and some formats for future offerings may not be files at all, but hardcover and paperback editions.
What I want to accomplish is one main listing for each publication (for the article list on the bookstore landing page), with subordinate listings for each format. Amazon, for example, displays a list of formats in each listing, with unique information for each format. The problem I anticipated with the solution Springworks suggests is that each format requires more than one field. That’s why I was looking at soo_multidoc.
I’m still not sure if soo_multidoc is the best solution for this problem, but now you know more about what I’m working with. I’m very grateful for whatever guidance or wisdom you might offer.
Thanks!
Last edited by johnstephens (2014-02-11 15:47:28)
Offline
Re: What's the best way to publish the same content with different flavors
Thanks for posting the example, John, that makes things much clearer.
To a degree, how you decide to implement this depends on the abilities of the people who will implement it.
One of my first Textpattern sites was an ecommerce site (now long gone) with a similar problem.
In the end, I use one custom field per property and separated the different values with pipe characters (|). I then wrote a bit of PHP to iterate over the values and build HTML select menus for each item. (rah_repeat
didn’t exist when I was developing the site!)
So for example, if you had one field for format, one for price and one for ISBN, the values could be:
Format: ePub for iBooks|Kindle|ePub for Nook|ePub
Price: 7.99|7.99|7.99|7.99
ISBN: 978-1-939831-01-9|978-1-939831-02-6|978-1-939831-01-9|978-1-939831-01-9
So long as the values are in the correct order for each field, and you have the same number of entries in each field, you can iterate over them using a rah_repeat
loop to pull out the different data.
This does require the data input for each item to be strictly followed though, so it may be too much of a stretch for a non-technical client who wanted to update their own content.
Offline
Re: What's the best way to publish the same content with different flavors
Thanks again, Springworks. I had to confer with the client to determine their comfort with entering multiple data in a field, but they were disposed to try it, and this is the method I used. Cheers!
Offline
Re: What's the best way to publish the same content with different flavors
johnstephens wrote #279318:
Thanks again, Springworks. I had to confer with the client to determine their comfort with entering multiple data in a field, but they were disposed to try it, and this is the method I used. Cheers!
No problem, that’s great news. Thanks for letting us know how it worked out.
Offline