Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2020-01-05 12:31:08

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
Website

Re: How to for writers

phiw13 wrote #320842:

It only sort of work on a very good day. The lady often and regularly forgets how to view (view link) or access (search the article by date/ id in the backend).

You need documentation for the documentation, you know. ;)

(I still think a printable PDF is the fall back for most of the world. It enables them to remain in the panel context they’re trying to do something in while looking at the docs too, while using it to fan themselves.)

Offline

#17 2020-01-05 13:11:27

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

Re: How to for writers

There will be nothing stopping anyone creating a pdf, and uploading it on site for future reference:) I think that the idea is extending rather than excluding any other currently used methods.


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

Offline

#18 2020-01-05 16:57:03

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,446
Website GitHub

Re: How to for writers

The Start area was designed specifically for this, as jakob says. Use it like he says. Or there’s nothing to stop you writing a how-to guide here, even making a bunch of documentation tabs linked from the first

Btw, instead of writing this as a plugin or using smd_tabber, you should be able to do it as part of your theme if you hook into some callbacks with it.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#19 2020-01-05 18:18:44

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

Re: How to for writers

Bloke wrote #320851:

The Start area was designed specifically for this, as jakob says. Use it like he says. Or there’s nothing to stop you writing a how-to guide here, even making a bunch of documentation tabs linked from the first

Btw, instead of writing this as a plugin or using smd_tabber, you should be able to do it as part of your theme if you hook into some callbacks with it.

Hold your horses:) The idea, is of no use to me. I have no website clients and the sites I am working on, are administrated fully by me with contributors who they have nothing to do with the back end. This is an idea which, I think that it will assist the designers, many of whom might know xml type syntaxes (like the txp tags), but they might have very little knowledge of php. Shouldn’t this be one group txp should be targeting?

ps… I just downloaded the tabber to experiment with its capabilities:)


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

Offline

#20 2020-01-05 18:43:57

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,197
Website GitHub

Re: How to for writers

Bloke wrote #320851:

Btw, instead of writing this as a plugin or using smd_tabber, you should be able to do it as part of your theme if you hook into some callbacks with it.

Nice! Can you elaborate on this?


TXP Builders – finely-crafted code, design and txp

Offline

#21 2020-01-05 22:19:25

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,446
Website GitHub

Re: How to for writers

jakob wrote #320854:

Nice! Can you elaborate on this?

Certainly. In your theme’s .php file, just after the class opening definition, add a constructor:

public function __construct()
{
    if (!has_handler('abc_dashboard')) {
        add_privs('tab.start', '1,2,3,4,5,6');
        add_privs('abc_dashboard', '1,2,3,4,5,6');
        register_tab('start', 'abc_dashboard', 'My Dashboard');
        register_callback(array($this, 'draw'), 'abc_dashboard');
    }

    $this_theme = str_replace('_theme', '', __CLASS__);
    parent::__construct($this_theme);
}

Then, somewhere within your theme’s class, define your draw() method that will render your initial tab contents:

public function draw($evt, $stp)
{
    echo pagetop();
    echo '<h1>Hello dashboard world</h1>';
    echo '<p>Pleased to meet you!</p>';
}

Job done. Rinse and repeat the callback/tab registration in the conditional inside your constructor with as many tabs as you like and pass control of each to their own method.

You can use all plugin-type features here: even steps if you wish so you can show different content based on the &step= in the URL. That would enable you to have one draw() method and differentiate on the step instead.

The above is all smd_tabber does, just wrapping this up with some UI fluff.

If you want to defer control of content to a page, then use something like this in your draw() method (untested):

include_once txpath.'/publish.php';

$html = fetch_page('some-page', 'some-public-theme');
echo parse($html);

That should get you going.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB