Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2021-02-16 03:52:23

marios2
Member
From: Germany
Registered: 2019-07-31
Posts: 76

<txp:meta_description />

<txp:meta_description /> does not output anything in any context page.
I am using TXP 4.8.2

rgrds marios

Offline

#2 2021-02-16 08:46:14

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,138
Website

Re: <txp:meta_description />

Can you clarify this a little ? What kind of code are using etc.

Per the docs, by default the outputted element would be basically invisible (as would any <meta name="" content="{your description}" />).


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#3 2021-02-16 09:44:46

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

Re: <txp:meta_description />

Yes, where are you intending this to be displayed? If you use it without any arguments it will display a meta tag designed for use in the <head> of your page. If you want to display the content elsewhere, you need to use the format="" attribute.

Finally, the type of description is context sensitive and it tries to be smart about which description it pulls based on where the tag is used (section, category list, article, etc). If you want to display a specific description you can override the context with the type attribute.


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

#4 2021-02-17 13:45:12

marios2
Member
From: Germany
Registered: 2019-07-31
Posts: 76

Re: <txp:meta_description />

Well, I’m thinking this to be a bug. I am using it without any arguments in the header section in a page template without any conditionals around.
It did not display any errors in debugging mode either.

rgrds, marios

Offline

#5 2021-02-17 14:46:13

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

Re: <txp:meta_description />

Hmmm, it works for me. Steps to success:

  1. In your page template inside the <head>, add <txp:meta_description />. Ensure it’s being edited in the correct Theme: either your in-use public theme if you intend to view the site from a non-logged-in account, or in your current development theme if you’re testing.
  2. Visit Presentation>Sections.
  3. Click the section you want to set the description for.
  4. Type in your description (max 255 chars) and save the Section.
  5. Open an article that’s in that same section.
  6. In the Meta area, enter a description for the article and Save it.
  7. View your front-end section landing page for that section and look at the source code. See the <meta> tag with the content from the Section is there in the <head>.
  8. Navigate to the individual article in that section and view source. See the <meta> tag with the content from the article is there in the <head>.

That’s the context sensitivity at play. If your experience differs to the above, I’d like to know about it because then it’s a bug.


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

#6 2021-02-17 16:10:11

marios2
Member
From: Germany
Registered: 2019-07-31
Posts: 76

Re: <txp:meta_description />

Oh, my bad. I seem to have missed the meta description fields in the backend on articles and sections. No bug,…all is good.

rgrds, marios

Offline

Board footer

Powered by FluxBB