• Hi,

    Just installed your front end editor plugin and I must say, its just what wordpress needs. Very usefull!

    I do have one little niggle, perhaps it is something really easy but as a slight newbie to wordpress its doesnt seem so simple.

    I want to us the plugin to edit my pages but only certain parts of my pages. For example, if I have pages with images and blocks of text ( lets say “<img src=”nice” /><div class=”edit_div”>this text block</div>”) in the content, i would only want the user to be able to edit any content within the divs with the class name “edit_div”.

    I have looked through all the documentation and your plugin code but im not really sure where to start.

    Any help on this would really really appreciated.

    Thanks in advance

Viewing 14 replies - 1 through 14 (of 14 total)
  • I could add an [editable] shortcode… so that you could make the code look like this:

    <img ... />
    
    <div>[editable]The editable text[/editable]</div>
    
    More content here...
    Thread Starter alec-taylor

    (@alec-taylor)

    That would be brilliant, although I have made a little hack, using the chunks function and changing the split function to look for <p class=”edit_text”> instead of just <p>.

    It seems to have kinda worked but when i have 2 editable elements on the page when i try to open the second one, nice edit doesnt appear and it just displays the text with the <p> tag around it.

    Is there anyway that I could limit the opening of the niceedit interface so that there can be only one instance at a time?

    Thread Starter alec-taylor

    (@alec-taylor)

    Hmm…I think your shortcode idea would be really good. It seems that trying to use the edit chunks function along with the image editor doesnt work very well.

    Would it be fairly easy to implement the shortcode?

    It’s doable, but not exactly easy.

    That would be brilliant, although I have made a little hack, using the chunks function and changing the split function to look for <p class=”edit_text”> instead of just <p>.

    It seems to have kinda worked but when i have 2 editable elements on the page when i try to open the second one, nice edit doesnt appear and it just displays the text with the <p> tag around it.

    I think you won’t have that problem if you apply the hack on the latest development version (note that it requires WP 3.0-beta1).

    hi everyone…
    greeeeeeat plugin…

    can i continue this discussion?

    `<div>[editable]The editable text[/editable]</div>

    More content here…`

    why not?
    that make possible creating a template editable just in some element of specific and dinamic content…

    eg.
    if i need ask my users about list of questions…

    in my post i can write something like below (and user could just answer without corrupting my text):

    <p><span>QUESTION:</span> Who was the man that bla bla bla bla bla bla bla bla?<p>
    <div><span>ANSWER:</span> [editable]The editable text[/editable]</div>
    <p>other content</p>
    <p><span>QUESTION:</span> Who was the man thatbla bla bla bla bla bla bla?<p>

    other ways???
    there is a way that works just now???

    thanks and regards,
    hanslukas
    (sorry for my english :p)

    <div>[editable]The editable text[/editable]</div>

    More content here…

    why not?
    that make possible creating a template editable just in some element of specific and dinamic content…

    I didn’t say it was a bad idea, just that it’s hard to implement robustly.

    other ways???
    there is a way that works just now???

    Well, you could create a page template that would look something like this:

    <?php
    // Template Name: Partially editable page
    
    get_header();
    ?>
    
    ...
    
    <p>Some text here</p>
    
    <?php editable_post_meta($post->ID, 'first_block', 'rich'); ?>
    
    <p>Some more text in-between.</p>
    
    <?php editable_post_meta($post->ID, 'another_block', 'input'); ?>
    
    ...

    yes… it work…
    is a way… thanks… ??

    just is a bit more complicated… but works…
    very very thanks…

    a question:
    why nicedit strips my paragraphs tags when i save my input?

    of course can’t a P inside a SPAN before and some P inside a P after…
    but some BR could stay everywhere…

    how would do it? have you time to post a solution? i know is very simple… for you :p

    anyway… thank…
    hans

    why nicedit strips my paragraphs tags when i save my input?

    how would do it? have you time to post a solution? i know is very simple… for you :p

    Actually it’s not, in this case, since I didn’t develop NicEdit. Also, WordPress tends to eat BRs too.

    creativetushar

    (@creativetushar)

    hey folks,

    I am not able to get page template with different editable regions
    here’s my code for page template – https://pastebin.com/fAhPSTdY

    I replaced the_content() with <?php editable_post_meta($post->ID, 'first_block', 'rich'); ?>

    let me know how to make it work

    thanks

    scribu

    (@scribu)

    @creativetushar:

    That approach requires you to actually move the editable parts from the post content into custom fields.

    Also, in your case, you don’t need to remove the_content(), just add editable_post_meta() right below or above it.

    The [editable] shortcode isn’t implemented yet, as it turns out to be harder than I expected.

    creativetushar

    (@creativetushar)

    <?php
    // Template Name: Partially editable page

    get_header();
    ?>

    <p>Some text here</p>

    <?php editable_post_meta($post->ID, ‘first_block’, ‘rich’); ?>

    <p>Some more text in-between.</p>

    <?php editable_post_meta($post->ID, ‘another_block’, ‘input’); ?>

    can u share full template example with 2-3 extra editable regions so that it helps a beginner like me

    scribu

    (@scribu)

    Here you go: https://pastebin.com/raw.php?i=mHw8nfc9

    If it still “doesn’t work” please explain exactly what you mean.

    creativetushar

    (@creativetushar)

    thanks scribu,

    so this is a template in which I can use custom fields to get more editable regions and I can wrap it in a div to style individual boxes… am I getting it right ??

    creativetushar

    (@creativetushar)

    I am implementing it now

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘[Plugin: Front-end Editor] editable parts in page content’ is closed to new replies.