The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
How do I populate editor from database?
I'm working on a custom bug tracker for my site and as part of it I need to be able to edit items that have been previously entered into the system which I can do fine for all fields apart from the editor where I get stuck.
So my question is quite simple: How do I load a message into the vbeditor? I have searched around quite extensively and thought about it but I can't think of an obvious solution so I thought I would ask in the hope someone can give me a point in the right direction. Thanks |
#2
|
||||
|
||||
http://www.w3schools.com/tags/tag_textarea.asp
HTML Code:
<textarea rows="10" cols="60"> Text here. </textarea> |
#3
|
||||
|
||||
Thanks Lynne but I don't think I explained my problem properly.
I know how to set the value of a textarea normally but I'm wondering how I do it for vbeditor as unlike the rest of my form it is being loaded from an external location using {vb:raw messagearea}. |
#4
|
||||
|
||||
I guess I don't understand then... if you look at the template for the editor you are using, you'll see something like this for the editor textarea:
HTML Code:
<textarea name="message" id="{vb:raw editorid}_textarea" rows="10" cols="80" tabindex="1" dir="{vb:stylevar textdirection}">{vb:raw newpost.message}</textarea> |
#5
|
||||
|
||||
Thanks once again Lynne - I'm closing in on the solution.
I'll try to explain my problem differently incase that helps. I used this article to include the WYSIWYG editor in my custom template. Using the method in that guide the editor is included by using {vb:raw messagearea} - which works fine for posting. What I'm struggling is using the WYSIWYG editor to edit existing messages. I've had a good search around the templates & functions but work out where to insert my value="x" |
#6
|
||||
|
||||
Do you have a custom page for editing this information? And have you written a query that gets the information from the database to edit?
|
#7
|
||||
|
||||
I've got a custom page, template and written the queries to populate the other fields and update the record on submission all I'm missing is the knowledge where to put the variable which outputs the unedited message.
|
#8
|
||||
|
||||
What does the code look like right before (and including) you render the template? and what is the name of the messagetext variable?
|
#9
|
||||
|
||||
Sorry I'm not quite sure which bit of the code you mean - I think you mean this bit.
Code:
$templater = vB_Template::create('edittask'); $templater->register_page_templates(); $templater->register('navbar', $navbar); $templater->register('pagetitle', $pagetitle); $templater->register('type_tasks_options', $type_tasks_options); $templater->register('task_user_options', $task_user_options); $templater->register('taskmanagerversion', $taskmanagerversion); $templater->register('editorid', $editorid); $templater->register('messagearea', $messagearea); $templater->register('edittask_name', $edittask_name); $templater->register('itemid', $itemid); $templater->register('edittask_id', $edittask_id); $templater->register('edittask_name', $edittask_name); $templater->register('edittask_desc', $edittask_desc); $templater->register('edittask_assigned', $edittask_assigned); $templater->register('edittask_duedate', $edittask_duedate); print_output($templater->render()); |
#10
|
||||
|
||||
Now I see you making a custom template called "edittask", but I have no clue what is in there - how are you using the variable $edittask_desc in the template?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|