Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2024-12-14 22:01:20

hug
Member
Registered: 2024-12-02
Posts: 11

Add Textile help or other snippet reminders in Write panel? (v4.8.8)

I’m coming back to Textpattern after about fifteen years away!

Is there a plugin that will add some of the Textile formatting examples, and ideally, allow me to add other snippets? I’m thinking about the “Textile Help” from the Write panel from 4.0-4.2 days. Rereading my paper copy of Textpattern Solutions reminded me of it.

For example, I’d put a sample snippet of <fox_code> to remind me of the syntax, instead of referring to other articles where I used that plugin. Or other writing-aide plugin examples.

—Hanna

Offline

#2 2024-12-14 23:02:37

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,642
Website GitHub

Re: Add Textile help or other snippet reminders in Write panel? (v4.8.8)

Hi and welcome back!

The only plugin I can think of, although it’s not supported any more, would be adi_notes which allowed you to put post-it style notes on various admin pages. Not even sure if the plugin might have allowed you to configure the messages per user level, not entirely sure.

Someone could dig out the latest copy for you if that sounds like it might be useful. And if it doesn’t work on recent versions of Textpattern then we can patch it for you.

An alternative might be smd_tabber which allows you to add dashboard-style panels to your admin side anywhere you like. So you could just build a generic “help” menu panel somewhere in the back-end that people could refer to.

Note, btw, that the latest Textile demo site has all the syntax highlighting and info about the latest release so you can link to that if you want to.

Failing those options, it’s probably new plugin territory. I don’t know of any other plugins that offer such functionality… unless somebody else knows of one?


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

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2024-12-15 01:10:20

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,341
Website

Re: Add Textile help or other snippet reminders in Write panel? (v4.8.8)

Above the article body field, next to the “Use Textile / Leave text untouched /…” select widget, there is an icon that links directly to the Textile demo / help site that Stef mentions – granted, smallish and not very obvious what it does.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#4 2024-12-15 03:11:54

hug
Member
Registered: 2024-12-02
Posts: 11

Re: Add Textile help or other snippet reminders in Write panel? (v4.8.8)

Thank you for the suggestions!

I see the Textile help on the Write panel, which opens in a new tab. I do use that for looking up the things I forgot how to do. Having my own notes on the write page, like the older Txp admin interface used to have, is the goal.

The adi_notes plugin looks like it’s been updated for PHP 8 and Txp 4.8.8, so will look at giving it a go. Firstly, though, there’s a TinyMCE plugin that the notes plugin can utilize, and am working through its installation.

Thanks again!
—Hanna

Offline

#5 2024-12-15 10:45:07

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

Re: Add Textile help or other snippet reminders in Write panel? (v4.8.8)

hug wrote #338534:

Thank you for the suggestions!

I see the Textile help on the Write panel, which opens in a new tab. I do use that for looking up the things I forgot how to do. Having my own notes on the write page, like the older Txp admin interface used to have, is the goal.

The adi_notes plugin looks like it’s been updated for PHP 8 and Txp 4.8.8, so will look at giving it a go. Firstly, though, there’s a TinyMCE plugin that the notes plugin can utilize, and am working through its installation.

Yes, I made a couple of fixes a few years back. From brief testing, it still works on txp v4.9 and right up to the most recent php8.4, but I never tried its integration with TinyMCE. Just make sure you use the self-hosted version of Tiny, or if you use their free plan that your usage remains within the plan scope. The fee for exceeding the quota of editor loads is punitive (40$).

Bloke wrote #338531:

Failing those options, it’s probably new plugin territory. I don’t know of any other plugins that offer such functionality… unless somebody else knows of one?

Off the top of my head, one approach to this that would be simple UI-wise and not quite as ever-present as adi_notes might be to use the pluggable_ui callback for the write panel (e.g. extend_col_1) to insert one or more links into the write tab sidebar that open a pophelp window. Ideally, the pophelp content could be defined in a custom form category, e.g. “help” or “admin_notes”. That would give you an on-demand floating window with your own reference material.

A dev question in this regard: as far as I can tell, the pophelp function (or rather the /textpattern/Module/Help called within it) requires a pophelp item defined in an xml file. Is it currently even possible to populate the pophelp content from another user-configurable source such as a form? Or would it be better to build one’s own parallel pophelp_from_form() function based on the existing pophelp function?


TXP Builders – finely-crafted code, design and txp

Offline

#6 2024-12-15 10:45:32

etc
Developer
Registered: 2010-11-11
Posts: 5,325
Website GitHub

Re: Add Textile help or other snippet reminders in Write panel? (v4.8.8)

Technically, that’s rather easy:

  • Enable ‘Advanced options’ and create HTML mediatype:
[html]
mediatype="text/html"
title="HTML"
  • Create HTML-type userhelp form, where you can put any help content you need.
  • Install a tiny admin(async) plugin:
register_callback(function ($event, $step, $pre, $rs) {
	$content = '<iframe src="'.hu.'?f=userhelp" style="border:none; width:100%"></iframe>';
    return wrapRegion('txp-userhelp-group', $content, 'txp-userhelp-group-content', 'help', 'article_userhelp');
}, 'article_ui', 'extend_col_1');

Compiled plugin, just in case:

# Name: abc_help v0.1
# Type: Back-end only (async) plugin
# No description
# Author: Oleg
# URL: http://localhost/textpattern/
# Recommended load order: 5

# .....................................................................
# This is a plugin for Textpattern CMS - https://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# .....................................................................

H4sIAAAAAAAACm1R0U7jMBB8Bol/sKyiFIk2cUqOxqXcD5xA4gci1940Fsa2bKeAEP9+6zaV
TifyEHt2Ztezu4Izxr8iv+NUOgV0E3ndIgiw1zFB6KQwZifk67wfrUzaWTKfwQFsuiUzFHg8
fAD8h3hDvq4uL2bS2YQ82ZLiQfdBvAGJQW5psRzGZfG7344RwgDGUxLTp4Et3bmgIHDrLGzI
u1Zp4KyqrunjQ3kq8Fhsri4JfgHSGCx5D8K/oENn50X68ItzxcU+uNEX6GYycUt+4BcTiboi
R/MpQtLSQHdWFjf44ve/hM4y+MBE1UlnOoaSPK57Tg8QInrJaMVptWT5hkNMnx4nqvkdwobT
Y5cZN4h/cSrGNLiQtQzFzwb25I8bX7Ww7nCMVmdNNwZ9Wg2nQ0qel6VxuJnBxVQmNOVFwmXZ
8pjGOFUQZdA+Ta5y/SdH/ouipd6IfcyWqpNji8PO1Bpf3snuuKXJiXFCdVMLGOG0mfp9U6db
jTlN20DF6rZuW8bkupbr1Wrd9vd9r1aqaenm+y8u5bXVcQIAAA==

Offline

#7 2024-12-15 10:49:05

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

Re: Add Textile help or other snippet reminders in Write panel? (v4.8.8)

Hehe, Oleg is fast and already has a solution along similar lines! That inserts it as a collapsible block in the sidebar, right?


TXP Builders – finely-crafted code, design and txp

Offline

#8 2024-12-15 10:51:53

etc
Developer
Registered: 2010-11-11
Posts: 5,325
Website GitHub

Re: Add Textile help or other snippet reminders in Write panel? (v4.8.8)

We thought alike :-) Yep, but it shouldn’t be difficult to wrap it into a standard txp jQUI Dialog.

Offline

#9 2024-12-15 11:23:32

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

Re: Add Textile help or other snippet reminders in Write panel? (v4.8.8)

If it’s any use, this is the textile help from the earlier version that you could put in that form. The admin css doesn’t carry over into the iframe, so some basic styles need defining:

<style>

body {
font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-size: 13px;
line-height: 1.5384615;
}

ul.plain-list {
list-style-type: none;
margin-left: 0;
padding-left: 0;
}

ul.plain-list li {
margin: 0 0 2px 0;
}

a {
color: #004bbd;
text-decoration: none;
}
a:hover {
color: #06f;
text-decoration: underline;

}
</style>

<ul class="textile plain-list">
	<li>header: <strong>h<em>n</em>.</strong></li>
	<li>Blockquote: <strong>bq.</strong></li>
	<li>Numeric list: <strong>#</strong></li>
	<li>Bulleted list: <strong>*</strong></li>
</ul>

<ul class="textile plain-list">
	<li>_<em>emphasis</em>_</li>
	<li>*<strong>strong</strong>*</li>
	<li>??<cite>citation</cite>??</li>
	<li>-<del>deleted text</del>-</li>
	<li>+<ins>inserted text</ins>+</li>
	<li>^superscript^</li>
	<li>~subscript~</li>
</ul>

<p class="textile">"Link text":url</p>

<p class="textile">!/image/url.jpg!</p>

<p><a href="https://textile-lang.com/" target="_blank">More</a></p>

Maybe that helps?

PS: If you want the drop-down to be taller, define a specific height for the iframe in the plugin code, e.g. height="350" for the above snippet.


TXP Builders – finely-crafted code, design and txp

Offline

#10 2024-12-15 11:58:07

etc
Developer
Registered: 2010-11-11
Posts: 5,325
Website GitHub

Re: Add Textile help or other snippet reminders in Write panel? (v4.8.8)

jakob wrote #338542:

The admin css doesn’t carry over into the iframe, so some basic styles need defining:

If userhelp form does not contain txp tags, it does not have to be an iframe – this will do (even better):

$content = fetch_form('userhelp', 'four-point-seven');

Just replace four-point-seven with the corresponding theme name.

In this case, userhelp can be of any type, e.g. misc.

Offline

#11 2024-12-16 15:02:47

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,328
GitHub

Re: Add Textile help or other snippet reminders in Write panel? (v4.8.8)

hug wrote #338530:

Woah.

Offline

#12 2024-12-29 22:16:09

hug
Member
Registered: 2024-12-02
Posts: 11

Re: Add Textile help or other snippet reminders in Write panel? (v4.8.8)

Thanks, all who replied! It’s been busy here at the end of the year and I haven’t been able to work on my site as much as I would have liked. But, I recently found the sad_textile_bar plugin that give me common Textile shortcuts. Still doesn’t scratch the itch for my own custom snippets but it’s a step forward!

Last edited by hug (2024-12-29 22:16:31)

Offline

Board footer

Powered by FluxBB