Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2022-02-25 13:39:38

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

Re: [SOLVED] links count?

I wasn’t aware of that limitation, but glad you got it sorted. Yes, you can do either:

<txp:variable name="total_links"><txp:php>echo safe_count("txp_link", "1 = 1");</txp:php></txp:variable>

Below is every resource read or considered to some extent for the development of content in this website. New sources are added as they are considered. There are currently <txp:variable name="total_links" /> source items.

or:

<txp:php>global $variable; $variable['total_links'] = safe_count("txp_link", "1 = 1");</txp:php>

Below is every resource read or considered to some extent for the development of content in this website. New sources are added as they are considered. There are currently <txp:variable name="total_links" /> source items.

TXP Builders – finely-crafted code, design and txp

Offline

#14 2022-02-25 21:21:05

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,742
Website GitHub

Re: [SOLVED] links count?

Destry wrote #332821:

the real problem seems to be that you can’t add the txp:php tag in an excerpt field.

Are you sure it’s not just Textile getting in the way? Try turning the Textfilter to Leave Text Untouched in the Excerpt field and see if that works.


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

Board footer

Powered by FluxBB