Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-06-28 16:56:52

jpdupont
Member
From: Virton (BE)
Registered: 2004-10-01
Posts: 743
Website

Textpattern shortcode syntax like WP shortcode syntax

Is it possible to consider changing the syntax of shortcodes to adopt that of WP, with brackets?

<txp::media_file category="" filename="" sha256="" /> would become [media_file category="" filename="" sha256="" ]

Syntax alias of the original ???, simpler for the client.

Offline

#2 2018-06-29 11:17:27

etc
Developer
Registered: 2010-11-11
Posts: 2,778
Website

Re: Textpattern shortcode syntax like WP shortcode syntax

Given that brackets are sometimes used in not-shortcode fashions (e.g. [123 comments]), how would we tell the difference?


etc_[ query | search | pagination | date | tree | cache ]

Offline

#3 2018-07-05 16:55:47

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,203
Website

Re: Textpattern shortcode syntax like WP shortcode syntax

Hi Jean-Pierre & Oleg ;)

May be a possible solution: use of 3 brackets (inspired from the Gusto syntax https://css-tricks.com/prototyping-in-the-browser/):

[[[media_file category="" filename="" sha256=""]]]


Patrick.
G+
Github | CodePen

Offline

#4 2018-07-05 17:53:01

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 6,768
Website

Re: Textpattern shortcode syntax like WP shortcode syntax

I have to admit that changing the syntax would create a lot of work for me now. If there is a consensus I’d accept it but especially after GDPR I’m sure that some sites might also already be using the existing syntax in their articles


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Offline

#5 2018-07-05 18:58:11

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 858
Website

Re: Textpattern shortcode syntax like WP shortcode syntax

Pat64 wrote #312867:

[…] (inspired from the Gusto syntax https://css-tricks.com/prototyping-in-the-browser/):

In fact, it comes from CodePen.

From the CSS tricks article linked:

What’s that weird syntax with all the [[[ ]]]? That’s the HTML Include syntax for CodePen.

Anyway, I’m not sure that would really make users job easier (?)
And I also think that short tags are already in use in sites in production. It seems strange to me to ask to change this now; there were some bêta’s versions, and nobody complained before as far as I know.

Last edited by NicolasGraph (2018-07-05 19:02:42)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#6 2018-07-05 19:00:33

gaekwad
Member
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 2,327

Re: Textpattern shortcode syntax like WP shortcode syntax

Respectfully, please add my -1 to the consensus.

Online

#7 2018-07-05 23:28:05

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,502
Website

Re: Textpattern shortcode syntax like WP shortcode syntax

gaekwad wrote #312871:

Respectfully, please add my -1 to the consensus.

And mines (-2).

The bracket [] solution would confuse textpattern syntax (code that you use in an article to call / include something) with textile syntax (code that is used to format something).

Offline

#8 2018-07-06 09:17:57

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,203
Website

Re: Textpattern shortcode syntax like WP shortcode syntax

Sorry guys.
I didn’t read carefully this post and I understood “Add an alternative to TXP tags, a kind of shortcode syntax like WP ones for article text contents only”.
Please, don’t hurt me 😋.


Patrick.
G+
Github | CodePen

Offline

#9 2018-07-06 12:56:02

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

Re: Textpattern shortcode syntax like WP shortcode syntax

Pat64 wrote #312867:

[[[media_file category="" filename="" sha256=""]]]

Can’t that be accomplished with rah_replace/smd_wrap/preg_replace?


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

Offline

Board footer

Powered by FluxBB