Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#49 2011-05-23 15:09:02

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: smd_horizon: What's that coming over the hill...

Thank you, Stef.

I tried your ideas and still land at the same result.
Will move the whole shebang out of the article form context now and then see what happens.


A hole turned upside down is a dome, when there’s also gravity.

Offline

#50 2011-05-23 15:13:03

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

Re: smd_horizon: What's that coming over the hill...

jayrope wrote:

I tried your ideas and still land at the same result.

Odd, it works for me in my sandbox. Operative word is “sandbox” there, i.e. not the real world.

Will move the whole shebang out of the article form context now and then see what happens.

Hmmm, should work inside your article form, although I must admit my tests have always been at the Page level. You could try adding some creative debug="1" (or 2) to one of the plugin tags and see if the splurge of output sheds any light on things.

Last edited by Bloke (2011-05-23 15:13:27)


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

#51 2011-05-23 15:30:52

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: smd_horizon: What's that coming over the hill...

Moving everything out of the article form context doesn’t change a thing.
Could it be, that this doesn’t work in /title mode?

debug=“1” on the prev tag (outside an article context) gets me this:
select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where Status IN (4) AND ( Category1 IN ('txp:category1 />') OR Category2 IN ('txp:category1 />') ) AND Section IN ('figuren') AND (now() <= Expires or Expires = '0000-00-00 00:00:00') ORDER BY Section ASC,Category1 ASC,Category2 ASC,Posted ASC ++ MOST RECENT (PREV) ++ array ( )

Last edited by jayrope (2011-05-23 15:33:52)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#52 2011-05-23 15:40:22

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

Re: smd_horizon: What's that coming over the hill...

jayrope wrote:

Could it be, that this doesn’t work in /title mode?

Nope, works fine. But in order to use the prev/next tags you must have article context. Here’s my working code, for reference:

<txp:if_individual_article>
  <txp:smd_prev category='<txp:category1 />' >
    <txp:smd_link_to_prev>&laquo; Previous article</txp:smd_link_to_prev>
  </txp:smd_prev>
  <txp:smd_next category='<txp:category1 />'>
    <txp:smd_link_to_next>Next article &raquo;</txp:smd_link_to_next>
  </txp:smd_next>
<txp:else />
  <txp:older>Older &raquo;</txp:older>
  <txp:newer>&laquo;Newer</txp:newer>
</txp:if_individual_article>

EDIT: Oooh, just noticed I’m using smd_link_to_prev/next not the native TXP tags in this case. Probably a reason for that, but it escapes me at present. Try that with your setup. I’ll look into the differences next time I visit the plugin, as the native next/prev tags seem to “fall off” the end and start navigating non-categorized articles. Odd, and not wholly expected behaviour.

Last edited by Bloke (2011-05-23 15:45:12)


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

#53 2011-05-23 16:08:40

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: smd_horizon: What's that coming over the hill...

Confirmed, your script works, inside an article form. From your help file i couldn’t see, if i had to replace the old link_to_prev/next with smd_link_to_prev/next, when using smd_prev/next enclosing them already.
Thank you very much., Stef.


A hole turned upside down is a dome, when there’s also gravity.

Offline

#54 2011-08-14 15:19:26

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

Re: smd_horizon: What's that coming over the hill...

Hi Stef, did you ever find an answer to this request (the bit at the bottom regarding rel and title?) I’m also wanting to suppress the title as per this post. and have tried various combinations without success so far.


BB6 Band My band
Gud One My blog

Offline

#55 2011-08-16 09:35:56

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

Re: smd_horizon: What's that coming over the hill...

zero wrote:

Hi Stef, did you ever find an answer to…

Ooops, not yet. Forgot all about it. Will add it to the list of things to look at in the near future. Thanks for the reminder.


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

#56 2015-03-23 16:22:59

claywso
Member
From: Durham, NC USA
Registered: 2004-12-20
Posts: 57
Website

Re: smd_horizon: What's that coming over the hill...

Have a question about datasort, but not sure if this is still active.

If it is (and I hope so), i can’t seem to get the datasort to function correctly, it’s always showing the next article sorted by posted date.

I’m using:

<txp:smd_prev datasort="category1" ><a class="prev-post" href='<txp:smd_link_to_prev />'><i class="fa fa-angle-left"></i>Prev</a></txp:smd_prev>

with debug on, it shows

select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where Status IN (4) AND Section IN ('team-members')  AND (now() &lt;= Expires or Expires = '0000-00-00 00:00:00') ORDER BY Section DESC,Posted DESC

Not sure what I’m missing… Thanks for the help!

Offline

#57 2015-03-23 16:37:51

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

Re: smd_horizon: What's that coming over the hill...

claywso wrote #289317:

i can’t seem to get the datasort to function correctly, it’s always showing the next article sorted by posted date.

Well that doesn’t sound good. Though, under normal circumstances, you should not need to use datasort as it defaults to sorting by:

  • Section, then
  • Category1
  • Category2
  • Author

Does it do the same if you omit the datasort attribute?

From the debug output, it does appear that it’s not taking the category1 into account at all. Presumably your team-members section is using category1 in some capacity…

Must admit I haven’t run this plugin up for quite some time so I’ll give it a go tonight and see how it fares.


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

#58 2015-03-23 16:46:43

claywso
Member
From: Durham, NC USA
Registered: 2004-12-20
Posts: 57
Website

Re: smd_horizon: What's that coming over the hill...

thanks for the quick reply. all articles in the team-members section have a category assigned. when i remove the datasort it behaves exactly the same. maybe there’s some naming thing for category1 that has changed? (running 4.5.7)

this is the page template

<txp:output_form form="page-header" />
<txp:output_form form="body-nav" />                
<div class="page">
<section class="page-block">
	<div class="container">				
		<txp:if_article_list>
			<txp:article status="sticky" form="herotitle" />
		<txp:else />
			<txp:article form="team-member" sort='<txp:category1 />' />
		</txp:if_article_list>
	</div>
</section>
</div>
<txp:output_form form="page-footer" />	

article form ‘team-member’ is what includes the code in my original post…

thanks for your help, again.

Offline

#59 2015-03-23 16:52:27

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

Re: smd_horizon: What's that coming over the hill...

claywso wrote #289320:

<txp:article form=“team-member” sort=’<txp:category1 />’ />

What does that do? The <txp:category1 /> tag will return an anchor to the category. Perhaps you meant sort="category1"?

The plugin might then detect your sort order (stab in the dark, as it should have overridden your selection when using datasort, but it may well have just been confused by the article’s sort order).

Last edited by Bloke (2015-03-23 16:54:50)


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

#60 2015-03-23 16:58:26

claywso
Member
From: Durham, NC USA
Registered: 2004-12-20
Posts: 57
Website

Re: smd_horizon: What's that coming over the hill...

I added that in to see if I could fix it… changed to the below with no change…

<txp:output_form form="page-header" />
<txp:output_form form="body-nav" />                
<div class="page">
<section class="page-block">
	<div class="container">				
		<txp:if_article_list>
			<txp:article status="sticky" form="herotitle" />
		<txp:else />
			<txp:article form="team-member" sort="category1" />
		</txp:if_article_list>
	</div>
</section>
</div>
<txp:output_form form="page-footer" />

Offline

Board footer

Powered by FluxBB