Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2020-04-27 08:26:40

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 2,512
Website

Re: smd_textile_bar: Simple Textile insertion for the Write panel

colak wrote #322713:

Not quite. Every time you click the button, the next form is inserted.

isn’t it what I am saying ? while adding that for someone who makes heavy use of that button, the behaviour will become more predictable.


Where is that emoji for a solar powered submarine when you need it ?

Offline

#14 2020-04-27 08:40:28

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,562
Website GitHub

Re: smd_textile_bar: Simple Textile insertion for the Write panel

I could do a dropdown for the form insertion, I expect. Would have to play. I nearly did the same for the Hx heading cycler but chickened out. Perhaps if it’s possible to add an arrow to the right, like we do with the Search box, that might work? Click the main button to insert/cycle but click the adjacent arrow to drop down options.

I’d probably have to consult my SVG guru(!) to come up with an icon or some solution here. If anyone has any ideas on how to add this in CSS/JS terms for maximum accessibility, that’d be grand. I guess copying what we do in the HTML for Search is a start, but with some different styling to take up less space?

Unless you have some insight, I’ll also have to defer to Julian for the Dark Mode snafu. Thanks for the nudge. I know we were talking about styling SVG as we developed this, so we’ll need to do some tweaks and experiments I expect.

Some consistent, reusable style hooks would be an absolute boon here. Maybe Phil has some thoughts on this?


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

#15 2020-04-27 08:48:53

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 2,512
Website

Re: smd_textile_bar: Simple Textile insertion for the Write panel

Bloke wrote #322715:

Unless you have some insight, I’ll also have to defer to Julian for the Dark Mode snafu. Thanks for the nudge. I know we were talking about styling SVG as we developed this, so we’ll need to do some tweaks and experiments I expect. Some consistent, reusable style hooks would be an absolute boon here. Maybe Phil has some thoughts on this?

For starter, you could ease the problem by setting the color of the <a /> to inherit, and then do something for the background in dark mode. Dunno what Hive does nowadays with it, I fear it is not set in a screen and (prefers-color-scheme: dark) block though. there might be other issues and specificity problems though, don’t feel going through Hive to figure it out.

Last edited by phiw13 (2020-04-27 08:49:15)


Where is that emoji for a solar powered submarine when you need it ?

Offline

#16 2020-04-27 09:23:23

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,774
Website GitHub Twitter

Re: smd_textile_bar: Simple Textile insertion for the Write panel

phiw13 wrote #322714:

isn’t it what I am saying ? while adding that for someone who makes heavy use of that button, the behaviour will become more predictable.

Indeed. My apologies. Note to self. Read whole post next time:)


Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.

Offline

#17 2020-04-27 10:17:38

etc
Developer
Registered: 2010-11-11
Posts: 4,546
Website GitHub

Re: smd_textile_bar: Simple Textile insertion for the Write panel

Bloke wrote #322711:

Or not… sigh

Or is it probably input, not change?

Offline

#18 2020-04-27 11:49:11

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

Re: smd_textile_bar: Simple Textile insertion for the Write panel

Good point about dark mode. That should be doable. Phil sets a darkmode class so that should be straightforward. The svg are referenced as symbols so it should just be a case of changing the color with css.

The toolbar uses the same styling as phil’s heading element from the design pattern, and the button variant is the standard button styling, just slightly smaller. I don’t think there are any toolbar or tooltip styles in the design patterns but I’ll look at adjusting that so that we use the design pattern classes with overrides where necessary (though strictly speaking a toolbar is not a heading). That would make it at least better for others to theme. BTW: for those who would prefer/want to use other icons, you can switch out the symbols in the /textpattern/plugins/smd_textile_bar/data.txp file after installing.

I have a busy week ahead. Will see if I get some time in the coming evenings.


TXP Builders – finely-crafted code, design and txp

Offline

#19 2020-04-27 14:05:21

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,545
Website GitHub Twitter

Re: smd_textile_bar: Simple Textile insertion for the Write panel

Hi all, sorry for silence – busy times. Hope everyone is well and safe.

I’ve just seen this project, thanks for resurrecting it Stef! I think a lot of the style issues can be negated by using the UI we already have for buttons, button icons, etc (class names such as txp-button, ui-icon and so forth). That would make the plugin less reliant on a specific theme too.

If the SVG icons stored in the same way we do for the standard icon set in Textpattern too (as CSS background-image data URIs) then they use the same filtering to achieve dark mode/light mode.

Leave it with me for a few days and I’ll refactor some of the code in the plugin to achieve the above.

Offline

#20 2020-04-27 14:41:45

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,562
Website GitHub

Re: smd_textile_bar: Simple Textile insertion for the Write panel

philwareham wrote #322722:

If the SVG icons stored in the same way we do for the standard icon set in Textpattern too (as CSS background-image data URIs)

Ah. They’re not right now. We’re injecting them as SVG data elements directly.

But Julian did export them as PNGs I think, so that’s an option. Might be easier to figure out internationalising them that way, but that does mean installation is trickier, as it needs to be a zip bundle (which means 4.8 only) or a heavy plugin file with all the data: elements/base64-encoded chunks wrapped in it for installation.

I kinda like using the plugin table data column, so if we can keep that, great. But usability beats storage so if we need to encode the icons differently, that’s cool.

Would using such background elements affect the ability to use .txp-dropdown? I’ve got a halfway working prototype (with mismatched styling right now) in my local dev copy that adds a down-arrow to the right of the Form button that lets you pick a direct form for insertion. I’m exploring that and will commit the experiment if it works out, even if the styling needs tidying up.

Thank you in advance for any insight/code that meshes this better with core.

Last edited by Bloke (2020-04-27 14:42:40)


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

#21 2020-04-27 17:30:39

jrmartin
Member
From: California | Italy
Registered: 2013-03-07
Posts: 108
Website

Re: smd_textile_bar: Simple Textile insertion for the Write panel

jakob wrote #322709:

The textile bar will now have an insert form icon (a hexagon with a +). Click on that to insert <txp::your_short_tag /> into the Body or Excerpt field. If you have several such forms, clicking again with the cursor in the same place rotates between your custom short-tags.

So the writer will still need to add something like “id=12” to the short form to add a particular photo to an article? Hmmmm. It’s still a bit awkward if that’s the case.

Offline

#22 2020-04-27 19:43:44

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,562
Website GitHub

Re: smd_textile_bar: Simple Textile insertion for the Write panel

jrmartin wrote #322724:

So the writer will still need to add something like “id=12” to the short form to add a particular photo to an article?

How else do people specify an image if not by its ID? How do you want them to use this feature?

There are plenty of ways you can set up shortcodes to make people’s lives easier. There are plugins too. People don’t even need to enter an ID if you code it to get the ID from other fields.

Tell us how exactly you want people to be able to do what you want and we’ll see how best to help.


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

#23 2020-04-28 00:16:42

jrmartin
Member
From: California | Italy
Registered: 2013-03-07
Posts: 108
Website

Re: smd_textile_bar: Simple Textile insertion for the Write panel

I’m trying to make it easy for someone without the slightest interest in code to take one or more of their pictures and put them in the article at the appropriate points. I can tell them to copy the image code I use where they want the image and change it to add the proper id, but that’s quite clunky. It would be better to have the toolbar put the image code on the page with a text box so that the author could add the id or something like that.

In fact, instead of the image button putting !! on a page, if it could be re programed to drop <txp:images id=“xx” form=“images” /> in there I’d be happy happy.

(I understand I can use the article image for inputting the id for a single image, but I usually use that for the OG image.)

I hope I’m being at least somewhat clear here. I love the toolbar as it functions, but adding an image in Wordpress is so much easier—and that’s the CMS I have to convince them to abandon.

Offline

#24 2020-04-28 06:08:25

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,774
Website GitHub Twitter

Re: smd_textile_bar: Simple Textile insertion for the Write panel

jrmartin wrote #322726:

I’m trying to make it easy for someone without the slightest interest in code to take one or more of their pictures and put them in the article at the appropriate points. I can tell them to copy the image code I use where they want the image and change it to add the proper id, but that’s quite clunky.

I think that short-codes have opened a can of worms here. In reality, I do not think that there is a universally accepted way to insert images or any other short-codes within the text. I found that adi_notes offers the best way regarding reminders like that. By residing on the bottom of the pages tab, all they will need to do is copy/paste/edit. Furthermore you will have control as to what will be appearing in more complex shortcodes, such as in the example of a figure with custom caption, alt, etc.

(I understand I can use the article image for inputting the id for a single image, but I usually use that for the OG image.)

Are all your other custom_fields taken?


Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB