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...
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?
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.
hey folks,
I am not able to get page template with different editable regions
here’s my code for page template – http://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
@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.
<?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
Here you go: http://pastebin.com/raw.php?i=mHw8nfc9
If it still “doesn’t work” please explain exactly what you mean.
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 ??