Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-11-03 04:12:51

zeusdidit
Member
Registered: 2007-10-16
Posts: 111

Change Stylesheet from Write tab

I would like the ability to choose a stylesheet from the write tab as a drop down. I was thinking this may be possible using a customfield or an output_form. Or it could be a plugin. I was wondering if anyone had suggestions on how to pull this off?

The plan was to have an @import to call specific base styles unless there’s a better option…

Thanks,
Zeus

Offline

#2 2010-11-03 04:50:56

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,254
Website GitHub Mastodon Twitter

Re: Change Stylesheet from Write tab

You could using

  • override form (not tested)

or

  • a custom field (no pull down)

Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2010-11-03 05:16:12

zeusdidit
Member
Registered: 2007-10-16
Posts: 111

Re: Change Stylesheet from Write tab

so you mean create links to different stylesheets using form tags? Brilliant!

Offline

#4 2010-11-03 09:41:12

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: Change Stylesheet from Write tab

You can create different forms and select “Override form”. But this is rather difficult, becase you have to dublicate all form content that is used to render articles. To fix this you can use such code:

Your original default.article form (example):

<h1><txp:title /></h1>
<div class="entry">
  <txp:body />
</div>

Than you create new forms where you place your place @import:

form1:

<style>@import(1.css);</style>
<txp:output_form form="default" />

form2:

<style>@import(2.css);</style>
<txp:output_form form="default" />

After this you can:

  1. Select override form in writetab
  2. Change article presentation in one form, not jumping through several clones with style.

Second way to to this is to use glz_custom_fields, which provides select menu (or radio button) for custom_fields.


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

Board footer

Powered by FluxBB