Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#91 2014-04-11 14:11:39

sacripant
Plugin Author
From: Rhône — France
Registered: 2008-06-01
Posts: 478
Website

Re: smd_macro: Create custom virtual Txp tags that do stuff

Thank you for the reply, I understand

unfortunately it excluded the possibility of including coding macros in a workflow with a version code system (using GIT with cnk_versionning or rah_flat).

It is not possible to compile a form with a callback when it is modified / saved in the database?

With this type of form markup I would have been happy :

/*
[macros_name]
description = "macros description"
attributes[] = "attr|default-val|"
*/

<h1>macros-code</h1>

I don’t like coding in the back office of Textpattern

Offline

#92 2014-04-11 14:57:48

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,637
Website

Re: smd_macro: Create custom virtual Txp tags that do stuff

sacripant wrote #280191:

It is not possible to compile a form with a callback when it is modified / saved in the database?

Yes, it’s possible but I couldn’t think of a neat way to represent the attributes and stuff. Your suggestion might work, though all that extra typing is hardly intuitive and may be prone to error. Ideally the format would mimic the import/export ini format so I wouldn’t have to write much extra code, but the macro content is BASE64 encoded which is not very user friendly! Leave it with me and I’ll see if I can make it create/update macros on Form save.

Presumably with cnk_versioning, when you save a Form outside Txp, it magically calls the actual internal Textpattern function to save the Form to the database, so I can just hook into the regular admin-side Form->Save callback? Not sure how that plugin works as I’ve never used it.


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

#93 2014-04-11 19:52:02

sacripant
Plugin Author
From: Rhône — France
Registered: 2008-06-01
Posts: 478
Website

Re: smd_macro: Create custom virtual Txp tags that do stuff

Cool, hope is back.

Advantages to use Form for compose macros:

For users who codes from the back-office

  • Use the Tag builder to compose macros.
  • Better experience with use a plugin like spf_codemirror to compose macros.

For users who want to use a text editor

  • To code macros using cnk_versionning or rah_flat.
  • be able versioning macro code.

For you

  • Simplify the plugin: no longer need to maintain a specific tab in the back office

Disadvantages:

  • Lose Export/Import Functionnality, but Import But can be replaced by a simple copy/past in a form.
  • Need to learn the Header syntax for defining attribut, but a simple explanation and exemple in plugin Help…

I hope I have finally convinced you ^^

Offline

#94 2014-04-11 21:44:14

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,637
Website

Re: smd_macro: Create custom virtual Txp tags that do stuff

sacripant wrote #280195:

Simplify the plugin: no longer need to maintain a specific tab in the back office

Well I wasn’t going to remove the existing functionality. I was hoping to have the two run side-by-side. If you save a Form named smd_macro_megatag and it conforms to the right format, it’ll insert that as a macro into the database. If you then visit Content->Macros, you’ll see megatag there too and it can be edited there if you wish. Any changes you make there will be reflected in the smd_macro_megatag Form.

I might have to think about some preference (or something) to enable this facility because otherwise people who prefer editing in the admin interface and don’t want to clutter their Forms with macros would be able to continue to work as they do now. My current thinking is that deleting a macro from the Forms panel would delete it from the database and therefore also from the Content->Macros panel. I think a preference for governing whether macros are edited inside Forms, from an admin panel, or both would suffice.


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

#95 2014-04-14 12:22:10

sacripant
Plugin Author
From: Rhône — France
Registered: 2008-06-01
Posts: 478
Website

Re: smd_macro: Create custom virtual Txp tags that do stuff

Personally, if you want to offer users to keep editing and creation of macros from a specific tag, I think it’s a bad idea to propose two systems simultaneously.
This could be quite confusing to the user and subject to errors.

In my opinion, a preference that allows the user to choose one or the other method would be less disruptive.

But what does happen if the user decides to switch from one system to another while macros already exist?

Offline

#96 2014-07-06 00:28:57

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,416

Re: smd_macro: Create custom virtual Txp tags that do stuff

An observation:

When I use smd_macro and the specified language in Textpattern is German, then under “Content“ (“Inhalt”) I see “Macros” and all the labels are in English (no problem). But, if I specified the language to Spanish, then under “Content“ (“Contenido”) I see “smd_macro_tab_name” and many labels are different as for example “smd_macro_tag_definition”. Where can I change this?

Offline

#97 2014-07-06 22:25:17

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,637
Website

Re: smd_macro: Create custom virtual Txp tags that do stuff

GugUser wrote #281935:

When I use smd_macro and the specified language in Textpattern is German, then under “Content” (“Inhalt”) I see “Macros” and all the labels are in English (no problem).

Presumably your default installation (at the time you installed the plugin) was German. Thus the Textpack that shipped with the plugin inserted its (English) strings against your installed de-de language in txp_lang.

When you subsequently switch to Spanish (or any other language), only strings that had already been defined in core (such as Name and Description) are used, and everything else gets its raw string representation instead, because those strings have not been inserted against any other language.

Where can I change this?

  1. Visit my download master page
  2. Find smd_macro in the list
  3. Download the en-gb textpack
  4. Modify its contents so the strings on the right are in Spanish and the language designator is es-es
  5. Paste the file contents into the ‘Install Textpack’ box in your Admin->Preferences->Languages panel and upload them.
  6. Send me the Textpack so I can integrate it with the plugin and make it available for download for other users.

P.S. if you’d like to send me a translated de-de Textpack too, that’d be fabulous!


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

#98 2014-07-07 01:26:25

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,416

Re: smd_macro: Create custom virtual Txp tags that do stuff

Many thanks Bloke. I’ll translate the two files and send them back to you.

Offline

#99 2014-07-07 03:26:14

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,416

Re: smd_macro: Create custom virtual Txp tags that do stuff

smd_macro_v0.30_de-de_textpack.txt

#@smd_macro
#@language de-de
smd_macro_attributes => Attribute
smd_macro_att_clone => [+]
smd_macro_att_clone_help => Ein Attribut hinzufügen
smd_macro_cannot_import => Das Makro kann nicht importiert werden. Bitte überprüfen Sie die Berechtigungen der Ordner und die Einstellungen Ihres Servers.
smd_macro_choose => Makro zum Bearbeiten auswählen
smd_macro_clone => Duplizieren
smd_macro_created => Makro erstellt
smd_macro_deleted => Makro gelöscht
smd_macro_exists => Der Name des Makros existiert bereits oder ist inkompatibel
smd_macro_export => Exportieren
smd_macro_file_size => Die Makrodatei ist zu groß
smd_macro_import => Importieren
smd_macro_imported => Importiert:
smd_macro_invalid => Der Name des Makros ist ungültig
smd_macro_invalid_ini => Die Makrodatei ist nicht im erwarteten Format
smd_macro_not_imported => Nicht importiert:
smd_macro_overwrite => Überschreiben erzwingen
smd_macro_repname => Ersatzname
smd_macro_saved => Makro gespeichert
smd_macro_skipped => Übersprungen:
smd_macro_tab_name => Makros
smd_macro_tag_definition => Makrodefinition
smd_macro_tbl_installed => Tabelle installiert
smd_macro_tbl_not_installed => Tabelle nicht installiert
smd_macro_tbl_not_removed => Tabelle nicht entfernt
smd_macro_tbl_removed => Tabelle entfernt
smd_macro_upload => Makrodatei

Offline

#100 2014-07-07 03:27:23

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,416

Re: smd_macro: Create custom virtual Txp tags that do stuff

smd_macro_v0.30_es-es_textpack.txt

#@smd_macro
#@language es-es
smd_macro_attributes => Atributos
smd_macro_att_clone => [+]
smd_macro_att_clone_help => Añadir un atributo
smd_macro_cannot_import => El macro no puede ser importado. Por favor, examine los permisos de carpeta y la configuración de su servidor.
smd_macro_choose => Seleccione el macro para editar
smd_macro_clone => Duplicar
smd_macro_created => Macro creado
smd_macro_deleted => Macro eliminado
smd_macro_exists => El nombre del macro ya existe o es incompatible
smd_macro_export => Exportar
smd_macro_file_size => El archivo del macro es demasiado grande
smd_macro_import => Importar
smd_macro_imported => Importado:
smd_macro_invalid => El nombre del macro no es válido
smd_macro_invalid_ini => El archivo del macro no tiene el formato esperado
smd_macro_not_imported => No importado:
smd_macro_overwrite => Forzar sobrescribir
smd_macro_repname => Nombre de reemplazo
smd_macro_saved => Macro guardado
smd_macro_skipped => Saltado:
smd_macro_tab_name => Macros
smd_macro_tag_definition => Definición del macro
smd_macro_tbl_installed => Tabla instalada
smd_macro_tbl_not_installed => Tabla no instalada
smd_macro_tbl_not_removed => Tabla no eliminada
smd_macro_tbl_removed => Tabla eliminada
smd_macro_upload => Archivo del macro

Offline

Board footer

Powered by FluxBB