Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-06-22 13:47:03

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Need (good) advice

Hi folks ;)

For a current project, I need to display a block of text (a kind of ads to promote my client’s services) in front of all blogs contents.
These blocks must be chosen (by article id or by other internal choice system) or/and chosen randomly (so this is a limited list of static articles).

What’s the best plugin for this?
It seems there are a specialized smd_x plugin.

Thanks lot for your (best) advice.


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#2 2015-06-22 13:57:21

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: Need (good) advice

Hi Patrick,
If I understand you correctly. You need a kind of a randomiser of short phrases to be included in all pages.

In which case I would go the semi native way and use the links tab. I posted a tutorial on txptips regarding randomisation.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2015-06-22 14:03:23

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: Need (good) advice

Thanks lot!

Yeah, randomly or not (may be my client wants to choose a particular text to display).

But categories can be a good alternative in order to choose what to display.

Cool. Tks Yiannis.

Last edited by Pat64 (2015-06-22 14:12:55)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#4 2015-06-22 14:11:54

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: Need (good) advice

Pat64 wrote #291806:

Thanks lot!

Yeah, randomly or not (may be my client wants to choose a particular text to display).

Building on what I posted there, it could be

<txp:hide>the id number of the link in the linklist</txp:hide>
<txp:variable name="linkurl" value='<txp:link_url />' />
<txp:if_custom_field name="quotenumber">
<txp:linklist id='<txp:custom_field name="quotenumber" />'>
<blockquote><txp:link_description escape="" />
<cite><txp:link_title /></cite></blockquote>
<footer><a href="<txp:variable name="linkurl" />" rel="external"><txp:link_title /></footer></blockquote>
</txp:linklist>
<txp:else />
 <txp:hide>if there is no quote id associated with a particular article, pick one at random</txp:hide>
<txp:linklist category="my_link_list_quotes_category" limit="1" sort="rand()" wraptag="" />
<txp:if_variable name="linkurl" value="">
<blockquote><txp:link_description escape="" />
<cite><txp:link_title /></cite></blockquote>
<txp:else />
<blockquote cite="<txp:variable name="linkurl" />"><txp:link_description escape="" />
<footer><a href="<txp:variable name="linkurl" />" rel="external"><txp:link_title /></footer></blockquote>
</txp:if_variable>
</txp:linklist>
</txp:if_custom_field>

You could of course edit the above to suit your own needs.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2015-06-22 14:14:36

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: Need (good) advice

Ok. I see (and categories could be a good choice too).

Tks Yiannis ;)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#6 2015-06-22 14:20:25

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
Website

Re: Need (good) advice

smd_featured with the sort="rand()" limit="1" attributes might be a good fit too.


TXP Builders – finely-crafted code, design and txp

Offline

#7 2015-06-22 14:44:14

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: Need (good) advice

Thanks lot Jakob.


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

Board footer

Powered by FluxBB