Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#181 2011-11-29 13:54:00

totoff
Member
From: Cologne, Germany
Registered: 2011-04-04
Posts: 145
Website

Re: smd_tags: unlimited article, image, file and link taxonomy

hello,

thank you stef for this plugin. i got it set up and running for my specific requirement following this code you gave another user :

<txp:smd_if_tag_list>
   <txp:smd_tag_list wraptag="" break="">
      <h2>Articles that match tag '<txp:smd_tag_name title="1" />'</h2>
      <txp:smd_related_tags wraptag="ul" break="li" section="" />
   </txp:smd_tag_list>
</txp:smd_if_tag_list>

as expected, on a “landing page” this outputs links to all related articles together with the article title. however, i would rather like to output the article image/thumbnail than the title. ist there a way to achieve this? i’ve gone through tons of documentation but didn’t find a solution :-(

the reason behind is that i run a photoblog were image lists link to the articles containing the images. i would like to maintain this even in case i show lists of related articles.

your help is much appreciated.

christoph

Offline

#182 2011-11-29 14:02:56

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: smd_tags: unlimited article, image, file and link taxonomy

totoff wrote:

i would rather like to output the article image/thumbnail than the title. ist there a way to achieve this?

Sure. Just use any of Txp’s image tags inside <txp:smd_related_tags>. By default (i.e. without any form/container) it outputs the article title. An example:

<txp:smd_related_tags wraptag="ul" break="li" section="">
   <txp:images />
</txp:smd_related_tags>

Last edited by Bloke (2011-11-29 14:04:29)


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

#183 2011-11-29 14:27:57

totoff
Member
From: Cologne, Germany
Registered: 2011-04-04
Posts: 145
Website

Re: smd_tags: unlimited article, image, file and link taxonomy

what a quick answer. thank you!

yes, i had the same idea and tried this before i asked here. but unfortunately it leads to unexpected behaviour. if i omit the <txp:images /> tag i get a clean permlink to the article url

<a href="http://mysite.de/articles/2/mypost">mypost</a>

while with this code

<txp:smd_related_tags wraptag="ul" break="li" section="">
   <txp:images />
</txp:smd_related_tags>

leads to a link like that:

<a href="http://mysite.de/tag_landing/?context=image&p=8">
  <img src="http://mysite.de/images/8t.jpg"/> </a>

with a click on the link i stay on the “landing page” and only create image context – as far as i understand …

that’s were i stuck

best, christoph

Offline

#184 2011-11-29 14:53:44

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: smd_tags: unlimited article, image, file and link taxonomy

totoff wrote:

with a click on the link i stay on the “landing page” and only create image context – as far as i understand …

Ah, d’oh, sorry. That’s because the <txp:images /> tag tries to create a gallery for you, hence the anchors that it creates are for such a use and override the ones that smd_tags is creating. You probably want to actually specify what happens to each image inside the <txp:images> container:

<txp:smd_related_tags wraptag="ul" break="li" section="">
  <txp:images>
      <txp:permlink>
         <txp:thumbnail />
      </txp:permlink>
  </txp:images>
</txp:smd_related_tags>

(or whatever you want to show). Bear in mind that txp:images will use the article image list by default so you may need to mess with its attributes to get it to display what you actually want to see in the permlink(s).


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

#185 2011-11-29 19:13:51

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: smd_tags: unlimited article, image, file and link taxonomy

Hi Stef, I have this warning when installing smd_tags tables on PlanetHoster (mySQLServer version: 5.0.92-community) :

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.COLUMNS where table_name = 'an1011_smd_tags' AND table_schema = 'dorg_456tti-20' at line 1 select COLLATION_NAME from an1011_INFORMATION_SCHEMA.COLUMNS as INFORMATION_SCHEMA.COLUMNS where table_name = 'an1011_smd_tags' AND table_schema = 'dorg_456tti-2011' AND column_name = 'name' textpattern/lib/txplib_misc.php(653) : eval()'d code:625 safe_field() in .../txplib_db.php on line 89

Last edited by jpdupont (2011-12-19 09:24:39)

Offline

#186 2011-11-29 19:34:16

totoff
Member
From: Cologne, Germany
Registered: 2011-04-04
Posts: 145
Website

Re: smd_tags: unlimited article, image, file and link taxonomy

hi stef,

thank you pretty much, that works! i’ve limited the thumbnail output to “1” in order not to have all images on screen and that’s perfect.

					<txp:smd_if_tag_list>
   						<txp:smd_tag_list wraptag="" break="">
      						<h2>Articles that match tag '<txp:smd_tag_name title="1" />'</h2>
      						<txp:smd_related_tags wraptag="ul" break="li" section="">
   								<txp:images limit="1">
   									<txp:permlink>
   										<txp:thumbnail />
   									</txp:permlink>
								</txp:images>
							</txp:smd_related_tags>
   						</txp:smd_tag_list>
					</txp:smd_if_tag_list>

thanks again! christoph

Offline

#187 2011-12-04 21:22:38

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: smd_tags: unlimited article, image, file and link taxonomy

Although I’ve still got some way to go with a few bug fixes, the next version is stable enough to take for a spin in its current form so please consider grabbing a copy.

Current changes in what will become v0.41:

  • improved performance (again!) via cacheing. I’m most of the way there and have slashed the query count by up to 90% which will make both your hosts and clients really happy so please consider using this version, especially if you are using <txp:smd_tag_list /> which was the worst offender. I can probably shave off some more fat if I put my mind to it, but for now this is a radical improvement.
  • fixed (ahem, hid) information_schema warning on new installs (thanks jayrope).
  • fixed missing tag lists if no categories defined.
  • fixed bogus URLs in subdir installs in <txp:smd_tag_name /> (thanks sacripant / jpdupont).
  • fixed SQL error when deleting non-orphan tags (thanks tye).
  • smd_related_tags: added DB columns from recent Txp releases.

Last edited by Bloke (2011-12-04 21:23:43)


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

#188 2011-12-04 21:34:04

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: smd_tags: unlimited article, image, file and link taxonomy

No more warning on 0.41 install ! Thanks Stef !

Offline

#189 2011-12-06 21:35:49

totoff
Member
From: Cologne, Germany
Registered: 2011-04-04
Posts: 145
Website

Re: smd_tags: unlimited article, image, file and link taxonomy

sorry, i asume this a stupid question. but how do i update the plugin? i have several tags already assigned to articles and don’t want to loose it …

still new to textpattern …

thanks for your help

Offline

#190 2011-12-06 21:48:35

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: smd_tags: unlimited article, image, file and link taxonomy

totoff wrote:

how do i update the plugin?

Exactly as if you were installing it for the first time. That is:

  • (optional, but probably a good idea) Backup your database
  • Download the new plugin
  • Visit the Admin->Plugins tab
  • Copy and paste the plugin .txt into the install box
  • Hit Upload
  • Hit Install
  • Scroll down to the plugin in the list and click the ‘No’ to turn it into a ‘Yes’

Hope that helps.


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

#191 2011-12-06 21:50:16

totoff
Member
From: Cologne, Germany
Registered: 2011-04-04
Posts: 145
Website

Re: smd_tags: unlimited article, image, file and link taxonomy

thanks stef, sounds easy ;-) will do as advised.

Offline

#192 2011-12-11 10:32:35

totoff
Member
From: Cologne, Germany
Registered: 2011-04-04
Posts: 145
Website

Re: smd_tags: unlimited article, image, file and link taxonomy

good morning,

unfortunately i must come back to the forum as i have another difficulty with getting smd_tags to work:

i’m trying to output an article tag list on my default (aka home) page with smd_tag_list. this works well as long as i specify showall="1! as attribute. if i omit showall the tag outputs nothing. this is the code:

 <txp:smd_tag_list type="article">
  <txp:smd_tag_name link="1" />
  <txp:smd_tag_count />
  </txp:smd_tag_list>

other tags used on the default page are <txp:article_custom /> but not <article />.

this is the tag trace output:

<txp:smd_tag_list type="article">
		[SQL (0,00117897987366): show columns from smd_tags]
		[SQL (6,91413879395E-5): SELECT id, name, txt.type, parent, title, count(item_id) AS count,(SELECT CAST((rgt - lft - 1) / 2 AS UNSIGNED)) AS children,(SELECT COUNT(*) FROM smd_tags WHERE type='article' AND name=name AND lft < txt.lft AND rgt > txt.rgt)-1 AS level FROM smd_tags AS txt, smd_tags_used AS txu WHERE txt.type='article' AND tag_id = id AND item_id='8' GROUP BY id]
		[SQL (4,6968460083E-5): select lft as l, rgt as r from smd_tags where name='root' and type = 'article']
		[SQL (0,000243902206421): select id, name, lft, rgt, parent, title from smd_tags where lft between 1 and 12 and type = 'article' and name != 'root' and name = "smd_1236888994" order by lft asc]
	</txp:smd_tag_list>

i’m sure i’m doing something wrong. can someone point me in the right direction please?

many thanks!

edit. the tag trace with showall enabled:

<txp:smd_tag_list type="article" showall="1">
		[SQL (0,00187206268311): show columns from smd_tags]
		[SQL (0,000123977661133): select lft as l, rgt as r from smd_tags where name='root' and type = 'article']
		[SQL (0,000115871429443): select id, name, lft, rgt, parent, title from smd_tags where lft between 1 and 12 and type = 'article' and name != 'root' and 1=1 order by lft asc]
		[SQL (0,000112056732178): select count(*) from smd_tags_used where type='article' AND tag_id='23']
		<txp:smd_tag_name link="1" />
			[SQL (0,00156807899475): show columns from smd_tags]
			[SQL (0,000111103057861): select name,val,html from txp_prefs where name IN ('smd_tag_u_sec','smd_tag_u_pnam','smd_tag_u_ptyp') ORDER BY name]
		<txp:smd_tag_count />
			[SQL (0,00145506858826): show columns from smd_tags]
		[SQL (0,000101804733276): select count(*) from smd_tags_used where type='article' AND tag_id='17']
		<txp:smd_tag_name link="1" />
			[SQL (0,00142121315002): show columns from smd_tags]
			[SQL (0,0001060962677): select name,val,html from txp_prefs where name IN ('smd_tag_u_sec','smd_tag_u_pnam','smd_tag_u_ptyp') ORDER BY name]
		<txp:smd_tag_count />
			[SQL (0,00141310691833): show columns from smd_tags]
		[SQL (0,000110149383545): select count(*) from smd_tags_used where type='article' AND tag_id='18']
		<txp:smd_tag_name link="1" />
			[SQL (0,00141596794128): show columns from smd_tags]
			[SQL (0,000105142593384): select name,val,html from txp_prefs where name IN ('smd_tag_u_sec','smd_tag_u_pnam','smd_tag_u_ptyp') ORDER BY name]
		<txp:smd_tag_count />
			[SQL (0,00148510932922): show columns from smd_tags]
		[SQL (0,000100135803223): select count(*) from smd_tags_used where type='article' AND tag_id='22']
		<txp:smd_tag_name link="1" />
			[SQL (0,00147199630737): show columns from smd_tags]
			[SQL (0,000108003616333): select name,val,html from txp_prefs where name IN ('smd_tag_u_sec','smd_tag_u_pnam','smd_tag_u_ptyp') ORDER BY name]
		<txp:smd_tag_count />
			[SQL (0,00144910812378): show columns from smd_tags]
		[SQL (0,00010085105896): select count(*) from smd_tags_used where type='article' AND tag_id='24']
		<txp:smd_tag_name link="1" />
			[SQL (0,00142097473145): show columns from smd_tags]
			[SQL (0,000104188919067): select name,val,html from txp_prefs where name IN ('smd_tag_u_sec','smd_tag_u_pnam','smd_tag_u_ptyp') ORDER BY name]
		<txp:smd_tag_count />
			[SQL (0,00141501426697): show columns from smd_tags]
	</txp:smd_tag_list>

Last edited by totoff (2011-12-11 10:35:20)

Offline

Board footer

Powered by FluxBB