Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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 ?
Sand space – admin theme for Textpattern
Offline
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
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 ?
Sand space – admin theme for Textpattern
Offline
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 | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Offline
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
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
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
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
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
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
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 | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline