teppo Posted June 1, 2014 Share Posted June 1, 2014 Textarea Markup inputfield Loosely based on core module InputfieldMarkup, InputfieldTextareaMarkup works with textareas (FieldtypeTextarea) and outputs plain text, markup and optionally values from other fields in Page Edit (backend). That output can be configured via field settings (Input tab) and then modified on a per-page basis, though only by superusers. For an example this: Hello World, I'm a {{template}}, my ID is {{id}} and my name is {{name}}! Would result in a non-editable (except by superusers) "markup field" with content along these lines: Hello World, I'm a basic-page, my ID is 1001 and my name is About! Content pulled from other fields is sanitised using $sanitizer->text() with default options, so no markup should get through, max length for individual field value is 255 etc. The module is available from GitHub. For more details check out README and/or modules directory page. 16 Link to comment Share on other sites More sharing options...
renobird Posted June 1, 2014 Share Posted June 1, 2014 teppo, this is great! Thank you. Link to comment Share on other sites More sharing options...
apeisa Posted June 1, 2014 Share Posted June 1, 2014 Teppo, why is this Inputfield instead of textformatter? Or am I missing something? Link to comment Share on other sites More sharing options...
teppo Posted June 1, 2014 Author Share Posted June 1, 2014 Antti: this is intended purely for backend use.. and provides a way for superusers to edit field data. Inputfield seems just about right Link to comment Share on other sites More sharing options...
apeisa Posted June 1, 2014 Share Posted June 1, 2014 Ah, I had to browse code to grasp what it does. Now I get it (wohoo!). After understanding the code, readme makes totally sense First I understood only the field parsing part... Btw: I think the docs are pretty clear, it was just me taking own conclusions too early. Link to comment Share on other sites More sharing options...
teppo Posted June 1, 2014 Author Share Posted June 1, 2014 Good to hear that it makes sense (at least after a while). Seriously speaking, should probably start doing screencasts for all the modules.. these things are so much easier to show than explain 1 Link to comment Share on other sites More sharing options...
apeisa Posted June 1, 2014 Share Posted June 1, 2014 Usually few screenshots helps a lot too. 2 Link to comment Share on other sites More sharing options...
Macrura Posted June 5, 2014 Share Posted June 5, 2014 Having an issue here with this - the markup field shows for the non-superusers, but they are not able to save the page, basically they get an error saying they are not able to edit that field, even though that field is not being edited... this is such a great module, and so needed for inline help and instructions, notes etc.. hope this is not a hard fix!! Link to comment Share on other sites More sharing options...
teppo Posted June 5, 2014 Author Share Posted June 5, 2014 @Macrura: thanks for reporting this. A bit busy right now, but I'll take a closer look at that as soon as I can! Link to comment Share on other sites More sharing options...
owzim Posted June 7, 2014 Share Posted June 7, 2014 Great! Would also be cool to have a similar syntax like in selectors for accessing properties of fields: Hello World, I'm a {{template}} [...]. Oh, and my current relationship status is {{relationship.currentStatus}}. Infinitely deep of course Link to comment Share on other sites More sharing options...
teppo Posted June 7, 2014 Author Share Posted June 7, 2014 @Macrura: the issue you reported should be fixed now in version 1.0.2 of the module just pushed to GitHub. @owzim: I'll take a look at that, seems to make sense but needs some additional logic Link to comment Share on other sites More sharing options...
Macrura Posted June 7, 2014 Share Posted June 7, 2014 @teppo - great! thanks again for this module. Link to comment Share on other sites More sharing options...
teppo Posted June 7, 2014 Author Share Posted June 7, 2014 @Macrura: you're welcome @owzim: didn't realise that core already takes care of this, so it should pretty much work out of the box. At least that's true for Fieldtype Map Marker and repeaters (just tested). For the record, there's now some very basic output formatting (CSV, basically) for array type values built-in. The need for this came up while outputting values from repeaters, i.e. "here's a list of my friends: {{friends.name }}" (which should now output something like "here's a list of my friends: Smith, Johnson, Williams, Jones"). 1 Link to comment Share on other sites More sharing options...
owzim Posted June 8, 2014 Share Posted June 8, 2014 I've to admit I misunderstood the modules purpose, like @apeisa, I thought it was a Textformatter. Still don't understand. Gotta install this one ... Link to comment Share on other sites More sharing options...
Macrura Posted June 8, 2014 Share Posted June 8, 2014 this module is really helpful - here are some example use cases that i'm using for: 1.) i made a field at the top of a gallery item template which reminds the user to crop the frames and center the images prior to uploading, as well as some suggestions for naming conventions; so now when someone is adding an item they see those instructions right at the top of the editor; if there is a particular problem with any item in the gallery, i could as the superadmin go to that item and make a further note that this item has a problem.. 2.) i have a template for a class session which is edited using the PageTable module, and when editing that info in the lightbox it can be hard to sometimes remember which class you are editing, so i have a field at the top that says "you are editing a session for {class.title}" so i'm using this for context-aware inline help 2 Link to comment Share on other sites More sharing options...
Macrura Posted July 14, 2014 Share Posted July 14, 2014 we seem to be having the same issue again with non-superusers not being able to save (Only superusers can edit field) even though the user didn't edit the textarea markup field, since it is not editable for their role; (using 1.0.3) Link to comment Share on other sites More sharing options...
teppo Posted July 17, 2014 Author Share Posted July 17, 2014 @Macrura: I've just pushed 1.0.4 to GitHub. This version drops saveReady hook in favour of ___processInput() method. This actually eliminates the need to throw any exceptions, as the module can simply use current value and continue saving the page. Hope this helps -- and hope it doesn't cause any additional issues either. I've tested it in my own environment and everything seems to work just fine, but please let me know if anything goes wrong! 1 Link to comment Share on other sites More sharing options...
Macrura Posted July 17, 2014 Share Posted July 17, 2014 hi teppo - many thanks, will update the module soon - for now i gave that user superadmin to get through the project, and this issue wasn't happening on all pages, just certain ones; i will update module, reset the role and report back asap... 1 Link to comment Share on other sites More sharing options...
cjx2240 Posted May 27, 2021 Share Posted May 27, 2021 Hi, this is a blast from the past, 2014 the last time someone talked about this module in here! And what a great module it still is. Is this still the best place to discuss? I've noticed today that {{id}} doesn't seem to return anything in the user template, could there be some obvious reason for that which I'm missing? Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now