Jump to content

Danjuan09

Members
  • Posts

    9
  • Joined

  • Last visited

Recent Profile Visitors

1,212 profile views

Danjuan09's Achievements

Newbie

Newbie (2/6)

2

Reputation

  1. Hi Adrian Can't believe I missed the query way, schoolboy error. I think I was too wrapped up in process wire to even think properly. Your jquery suggestion works a treat. Thanks
  2. Hi I'm making my first module and i'm trying to add contenteditable='true' to a div so that <div class="container"></div> becomes <div class="container" contenteditable='true'></div> I've been trying $event->return = str_replace("</div class'container'>", $edit."</body>", $event->return); but that won't work
  3. Did you upload the and replace all the files? I would have thought this would of worked as the file structured remained the same.
  4. Thanks Adrian, i'll give them a look now and get back to you. Thanks
  5. Hey guys I'm developing my first template. I'm trying to get front-end inline editing so that when I am logged in as a superuser I am able to edit the text without having to go into the backend. Ideally I just want to change the text, no styling, arrangement etc, just the text. Please see attached what I currently have, it's very basic but if I add contenteditable="true", this allows me to edit the text as described. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>test</title> <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <style> * { padding:0; margin:0; } html { width:100%; } body { width:100%; } .edit-toolbar { height:40px; width:100%; background:red; } .edit-toolbar button { height:30px; width:50px; background:white; } .editable{ background:#EAEAEA} </style> </head> <body> <div id="welcomeDiv" class="edit-toolbar" style="display:none;"> <input type="button" id="save" value="save"/> <input type="button" id="cancel" value="cancel"/> </div> <?php if(wire('user')->hasRole('superuser')) echo' <input type="button" id="btn" name="answer" value="Edit"/> '; ?> <div id="container"> <?=$page->headline;?> </div> <script> $('#btn').click(function(){ $('#welcomeDiv').show(); $('#container').attr('contenteditable','true'); }) $('#save').click(function(){ $('#welcomeDiv').hide(); $('#container').attr('contenteditable','false'); }) $('#cancel').click(function(){ $('#welcomeDiv').hide(); $('#container').attr('contenteditable','false'); }) </script> </body> </html> I now need to add a few features. 1: An edit button (only show the edit button if logged in as a superuser), once this is clicked, it will add contenteditable="true" to the container div and show a toolbar with a further 2 buttons, 'save' and 'cancel'. When cancel or saved are clicked the toolbar will hide and contenteditable="true" will change to false. I have achieved this with the following code <div id="welcomeDiv" class="edit-toolbar" style="display:none;"> <input type="button" id="save" value="save"/> <input type="button" id="cancel" value="cancel"/> </div> <?php if(wire('user')->hasRole('superuser')) echo' <input type="button" id="btn" name="answer" value="Edit"/> '; ?> <script> $('#btn').click(function(){ $('#welcomeDiv').show(); $('#container').attr('contenteditable','true'); }) $('#save').click(function(){ $('#welcomeDiv').hide(); $('#container').attr('contenteditable','false'); }) $('#cancel').click(function(){ $('#welcomeDiv').hide(); $('#container').attr('contenteditable','false'); }) </script> 2: The following feature must only be accessible if the user is logged in as a superuser. I believe I have sorted this with the above code. 3: I need to be able to save the content replacing the current text, so that when I go back into the backend, the text is the new text I replaced, also if the cancel button is clicked, the text needs to revert back to the original text not what was just written. As far as i'm aware, number 3 is all I need help with unless anyone spots an error. Thanks
  6. Thanks guys for the reply's, I now understand a little more at least. I'll take a look at the links and hopefully by the end of the day i'll have a much better understanding.
  7. Hi After coming over from wordpress, i'm trying to get to grips with process wire and for the first hour i'm finding it hard to do the basic stuff. First off, how do I install a new theme? Also, do you call these profiles? Secondly, I understand you can install admin themes (are these actually called themes?) and how do you install these? So far from what I can understand, to install a new theme (or profile if that's what you call them) you need to do it on installation, surly this is not right? I've started going through the docs but i can't find theme or i've just looked at text for too long. Thanks
  8. Hey guys I've just started with process wire and i'm trying to get to grips with it. First off I have installed the default beginner theme just to get me started an to help me understand. I now want to implement CKeditor 4 to allow frontend inline editing before I start moving on and developing my own theme. I've found a board that already appears to have done this but at the moment it means nothing to me, can anyone help get me started. Thanks Here's the link: https://processwire.com/talk/topic/7366-frontend-form-with-tinymce-or-ckeditor-module/
  9. Hey guys, I've just found this great cms after using Wordpress and I am trying to get inline wysiwyg. Can someone please give me an idiots guide into how I input this into my theme. It's going to be hard enough learning a new software andi need the inline editing as soon as. Thanks
×
×
  • Create New...