Plugin Request: Page Templates - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: Plugins (http://get-simple.info/forums/forumdisplay.php?fid=13) +--- Thread: Plugin Request: Page Templates (/showthread.php?tid=3086) |
Plugin Request: Page Templates - alienee2 - 2012-04-19 I was thinking about a way to deal with pages that have a lot of complex markup, and be able to enable users to edit the relevant areas, without breaking that part of the code that is being hidden by the editor, such as divs, classes, columns, lists, tables etc.. so i propose a plugin where you can define a template in html, and then specify editable areas with some sort of tag; then users would create a page using this 'page template'; and the areas that you have defined as editable would be text areas or maybe wysiwyg; i think this kind of plugin would be useful and i've only seen something like this on mail marketing sites like campaign monitor... -marc Plugin Request: Page Templates - Angryboy - 2012-04-19 Could what you are asking be achieved with CustomFields? Create a field and give it a default value (basically the regular markup that would show up if it went unedited). Place the code: Code: <?php get_custom_field('fieldname'); ?> in your template where you want the markup to be editable, then the user could edit the markup within the page by clicking "Page Options" and editing the content of your custom field. You can also decide whether to make it a WYSIWYG field or a Multi line text field. Plugin Request: Page Templates - alienee2 - 2012-04-19 i'm thinking of those simple occasions where you have columns, blockquotes, tabs, and the like where you want to somehow prevent the user from messing up the markup... maybe shortcodes would be a possible solution... there are some joomla plugins that do complex formatting, like tabs, using tags like {tab=Title} some text {/tab} {tab=Title2} some text {/tab} {/tabs}.. -marc Plugin Request: Page Templates - n00dles101 - 2012-04-19 I have shortcodes plugin that hasn't been released to the public if you want to give it a try... works exactly like Wordpress shortcodes... let me know if your interested and I can put the code up somewhere Info on WP shortcodes here http://codex.wordpress.org/Shortcode_API Plugin Request: Page Templates - Angryboy - 2012-04-19 Perhaps DynPages? You can define the piece of markup that you want to be editable as a component. Then you place identifiers that say where the content is editable. So for example, with your one for columns you would make two components: column and column-end: column Code: <?php global $args; ?> Code: </div> Then on your page you would simply use the following content to call the whole column: Code: {% column 'FLOAT', 'WIDTH' %} COLUMN CONTENT {% column-end %} Changing 'FLOAT' to the direction of alignment, 'WIDTH' to the width of the column and 'COLUMN CONTENT' to whatever content you want. Basically, form your markup in a component with the code <?php global $args; ?> at the beginning of your component, then for every part of it that you want to be editable, use <?php echo $args[#]; ?>, numbering the arg accordingly starting from 0. When you use the placeholders on the page, you simply use the format { componentname 'arg0' 'arg1' etc... }. The markup can be as complicated as you need it to be. Plugin Request: Page Templates - Carlos - 2012-04-19 Maybe something can be done with CKeditor Read-only blocks. (No idea how this works, I just did a quick search...) Plugin Request: Page Templates - alienee2 - 2012-04-19 Angryboy Wrote:Perhaps DynPages? right on AngryBoy! - that's pretty much what i arrived at over the last 40 minutes.. Code: <?php global $args; ?> and the css has all of the column definitions.. it's working great - all the columns on this page are done like that: http://dev.propellant23.com/gs31b/index.php?id=columns-a-tables and my editor has this: Heading 1 Code: {% columns one-half %} Plugin Request: Page Templates - alienee2 - 2012-04-19 n00dles101 Wrote:I have shortcodes plugin that hasn't been released to the public if you want to give it a try... @n00dles101 - i would be really interested in trying the shortcodes.. in the meantime, the dynpages solution seems to work pretty well, but i could see the possibility for something more complex that dynpages wouldn't be able to accomodate... like tabs, since the ouput isn't linear.. -marc Plugin Request: Page Templates - alienee2 - 2012-04-19 Carlos Wrote:Maybe something can be done with CKeditor Read-only blocks. (No idea how this works, I just did a quick search...) wow - that's interesting - this is sort of what i was thinking of - i'll have to research this later...! -marc Plugin Request: Page Templates - Angryboy - 2012-04-19 You're welcome alienee22 :-) (did say that you come up with the same conclusion at the same time?) Another example is with embeding youtube videos. Component: youtube Code: <?php global $args; ?> Placeholder Code: {% youtube width, height, url, border %} Plugin Request: Page Templates - n00dles101 - 2012-04-19 @alienee2, let me clean up the code a little and i'll post it up. Plugin Request: Page Templates - alienee2 - 2012-04-19 n00dles101 Wrote:@alienee2, let me clean up the code a little and i'll post it up. @n00dles101 -thanks - that's great - no rush, but i am keen to try shortcodes..! I was able to get jquery tabs working with DynPages, and after reading the worpress wiki on shortcodes, the usage is very similar.. i'm wondering how you would use shortcodes differently that dynpages; i'm thinking that being able to use more php code in the processing is the main advantage; for example, with the tabs, i have to manually specify the id # of the tab heading to match the tab content div, and i'm thinking that in shortcodes i could just code the id #s to generate automatically... this is how i'm doing it now: Code: {% tab-heading %} -marc Plugin Request: Page Templates - alienee2 - 2012-04-19 Carlos Wrote:Maybe something can be done with CKeditor Read-only blocks. (No idea how this works, I just did a quick search...) Hey Carlos - good tip! it's super simple - you add contenteditable="false" to any element and then the user can't edit it.... the only slight drawback is that they can still delete it... but it does freeze whatever block of content and prevent inadvertent editing of that.. -marc Plugin Request: Page Templates - alienee2 - 2012-05-13 @n00dles101 - i would be interested in testing out the shortcodes plugin...any word on a beta release? Also - the matrix looks awesome; would you be able to post on how to output the data, i'm guessing one needs to use a foreach statement with the variable holding the query... Plugin Request: Page Templates - n00dles101 - 2012-05-13 @alienee2 - shortcodes is up on github @ https://github.com/n00dles/gs_shortcodes its fully working and I've included a lot of working shorcodes in gs_sortcodes/shortcodes.php I'll be releasing it at the same time as TheMatrix as both of them work very well together. The Plugin Tab - shortcodes info list the included shortcodes and the syntax... |