Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-12-20 12:55:02

milosevic
Member
From: Madrid, Spain
Registered: 2005-09-19
Posts: 390

[request] smd_unwrap: a plugin to remove HTML output of other plugins or txptags

Hello:

It is a request writen specially thinking on Bloke.

Reading de smd_wrap documentation I think it will be nice an inverse plugin: “smd_unwrap”.

The objetive will be clean the response of other plugins to easyly adapt dynamic data to a given HTML template.

This days I am fighting with mem_self_register, smd_bio and other stuff in a site I want to format folloging the Bootstrat CSS template system and I am spenting a lot of time trying to clean the forms, error message and other responses of the plugins I’m using in order to fix the result to the Bootstrat sintaxtis for HTML forms, errors, etc.

I think it will be very ussefull for many people, somethink like this:

<txp:smd_unwarp wraptag=“li” class=“foo”><txp:a_plugin_that_returns_html_formated_code/></txp:smd_unwarp>

This code will remove de wraptag li and the class “foo”.

possible params for smd_unwrap could be the tipical params for formating HTML outputs, but with the opposite functionality:

wraptag, break, class, labeltag, label…


<txp:rocks/>

Offline

#2 2011-12-20 13:04:18

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

Re: [request] smd_unwrap: a plugin to remove HTML output of other plugins or txptags

Not a direct answer but a few ideas:

  • You can use the smd_wrap attribute transform="strip_tags" to completely remove tags and then re-wrap that with smd_wrap with tags you want.
  • smd_wrap has a replace attribute that you can use to selectively remove/replace code from output.
  • you can chain transforms with smd_wrap.
  • For a great many txp tags you can opt not to use the wraptag, class, html_id, label and break attributes and do your own markup with unwrapped output.

TXP Builders – finely-crafted code, design and txp

Offline

#3 2011-12-20 15:46:22

milosevic
Member
From: Madrid, Spain
Registered: 2005-09-19
Posts: 390

Re: [request] smd_unwrap: a plugin to remove HTML output of other plugins or txptags

Wow! I didn’t show the transform=“strip_tags” param. Nice, then there’s no need of “smd_unwrap”. Thanks a lot!


<txp:rocks/>

Offline

#4 2011-12-20 16:33:40

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: [request] smd_unwrap: a plugin to remove HTML output of other plugins or txptags

There’s also my now redundant-ish (jee thanks bloke) plugin mrd_h2t which is a simple txp wrapper around a feature rich html to text conversion library.

Offline

#5 2011-12-20 21:00:27

frickinmuck
Member
Registered: 2008-05-01
Posts: 118

Re: [request] smd_unwrap: a plugin to remove HTML output of other plugins or txptags

TXP developers and plugin developers = <3


The AI does not hate you, nor does it love you, but you are made out of atoms which it can use for something else.

Offline

Board footer

Powered by FluxBB