Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2008-06-26 15:23:46

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: When creating a site with TXP, I rarely find myself...

uli wrote:

Ah, alright, I see! Will keep this in mind, can come in handy :)

To be honest, I’ve never found a use for it ;)

Does it also have access to other text strings?

As far as I know you can use all strings in the lang table: e.g. <txp:text item="need_details" /> will display Inevitably, we need a few details :)

BTW, a smart way to change truths really quickly and globally ;))

Hmm… I’m beginning to see whole new possibilities. Change your mind site wide…

political_preference =>

Offline

#17 2008-06-26 15:39:23

masa
Member
From: North Wales, UK
Registered: 2005-11-25
Posts: 1,095

Re: When creating a site with TXP, I rarely find myself...

I’m still puzzled. I’d rather use a form for this kind of snippet, as forms can be easily edited from the backend.

Textbook doesn’t even mention where the strings are stored.

Offline

#18 2008-06-26 15:50:31

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: When creating a site with TXP, I rarely find myself...

masa wrote:

Textbook doesn’t even mention where the strings are stored.

It uses the language file (or if you push your own strings onto $textarray) e.g., <txp:text item="tab_presentation"/>.

Offline

#19 2008-06-26 15:54:00

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,316

Re: When creating a site with TXP, I rarely find myself...

Els wrote:

political_preference =>

Don’t even need to leave values blank intentionally, you can change everything in the wink of an eye ;)

To be honest, I’ve never found a use for it ;)

I’m always good for mis-using “intended uses”. My mind’s spinning wildly: Put paths to images in the values (e.g. for diagrams), and you have language specific illustrations. Not that I’ve ever needed this, I just store such things in the depths of my brain cells. Mere luxury ;) But can come in handy (mantra against forgetfulness ;)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#20 2008-06-26 16:06:31

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: When creating a site with TXP, I rarely find myself...

Brain cells? Are we supposed to have those things? Don’t tell the politicians about this. ;)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#21 2008-06-26 16:44:24

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,316

Re: When creating a site with TXP, I rarely find myself...

jm wrote:

It uses the language file (or if you push your own strings onto $textarray) e.g., <txp:text item="tab_presentation"/>.

I’ve a gut feeling this can’t be the intended use, in terms of “originally intended”. As Martin states, what you and Els/Steve have mentioned here isn’t even documented.

I’m wondering at all because I’ve found this snippet <txp:section_list default_title='<txp:text item="home" />' include_default="1" wraptag="ul" break="li"> at a highly official place, with the shiny (almost unused) txp:text tag right in the middle. … Why that?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#22 2008-06-26 17:14:51

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: When creating a site with TXP, I rarely find myself...

That may be a simple example of the new tag parser in action allowing tags within tags.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#23 2008-06-26 17:19:58

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: When creating a site with TXP, I rarely find myself...

Els wrote:

As far as I know you can use all strings in the lang table: e.g. <txp:text item="need_details" /> will display Inevitably, we need a few details :)

Not quite. On the public face of your site, only those strings from the txp_langs table that are marked as public or common will get loaded. If you try outputting an admin-side or setup string you’ll just get its name, not the associated text.

Uli

You’re right about the possibility of using this for language-specific stuff. That’s basically what the MLP Pack does with its concept of snippets.


Steve

Offline

#24 2008-06-26 17:26:21

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: When creating a site with TXP, I rarely find myself...

uli wrote:

I’ve a gut feeling this can’t be the intended use, in terms of “originally intended”. As Martin states, what you and Els/Steve have mentioned here isn’t even documented.

The text function feeds the item value into gTxt(), which is used to output values from the lang table ($textarray). gTxt() doesn’t care if item is a valid key in $textarray though, so it’ll output whatever you feed it. (As far as I can tell at least – net-carver is the gTxt() pro around here!)

Offline

#25 2008-06-26 17:44:49

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: When creating a site with TXP, I rarely find myself...

uli wrote:

I’m always good for mis-using “intended uses”. My mind’s spinning wildly: Put paths to images in the values (e.g. for diagrams), and you have language specific illustrations.

Textpattern only loads one language into the internal $textarray John-Michael was talking about. So this tag is a little underpowered by default. It does allow a certain amount of string re-use — but only if there’s a suitable string in the default install, unfortunately this happens pretty infrequently so you have to start editing the txp_lang table to change the strings. Not pretty.

If you just want a site in a single language that had the occasional translated diagram or something then this is probably a hard way to crack the problem. If you want a real multi-lingual site then install the MLP Pack and the <txp:text /> tag starts to shine and you can indeed use it as you imagined — very successfully too.

jm wrote:

(As far as I can tell at least – net-carver is the gTxt() pro around here!)

Humbug.


Steve

Offline

#26 2008-06-26 21:55:47

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: When creating a site with TXP, I rarely find myself...

net-carver wrote:

Not quite. On the public face of your site, only those strings from the txp_langs table that are marked as public or common will get loaded. If you try outputting an admin-side or setup string you’ll just get its name, not the associated text.

Ah OK, I must admit I didn’t really try that one ;)

Offline

#27 2008-06-26 22:13:33

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,316

Re: When creating a site with TXP, I rarely find myself...

So this “riddle tag” post has actually yielded an incalculable result, the MLGraphics/MLFile Download (at least for me it has). Long live the “intended use” misuse ;)

Thanks to everyone who took the time to answer my questions :)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#28 2008-09-26 14:51:41

elliot100
Member
Registered: 2008-09-26
Posts: 13

Re: When creating a site with TXP, I rarely find myself...

After wondering about this tag myself and reading this thread, I’m assuming that it was originally intended for use only by developers of the default page and form templates, or for those publishing other internationalised themes; not for use by site developers.

Offline

#29 2008-09-26 18:17:15

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,421
Website GitHub Mastodon

Re: When creating a site with TXP, I rarely find myself...

elliot100 wrote:

After wondering about this tag myself and reading this thread, I’m assuming that it was originally intended for use only by developers of the default page and form templates, or for those publishing other internationalised themes; not for use by site developers.

Bingo.

Offline

Board footer

Powered by FluxBB