PDA

View Full Version : Move "Create New Article" button


Scitz0
15 Jun 2010, 20:25
Hi,

What code/template do I need to edit to move the "Create New Article" button to the bottom of the page?

I searched and found the template vbcms_toolbar and I think its this template I need to edit or maybe the call to load the template need to be moved?

Anyone know?

Lynne
16 Jun 2010, 03:46
To find the template to modify, do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code. (Sometimes the template is the one mentioned at the very top of the page source.)

Scitz0
16 Jun 2010, 08:43
To find the template to modify, do this - vboptions > General Settings > Add Template Name in HTML Comments > set to Yes . Then go back to your page and view the source code and you will see the name of the template called around your part of the code. (Sometimes the template is the one mentioned at the very top of the page source.)
Ok thank you, will try this method.

--------------- Added 1276678759 at 1276678759 ---------------

Worked like a charm, found that I needed to edit vbcms_page and move the toolbar row at the bottom of the template.

Scitz0
19 Jun 2010, 07:09
Ok, back to moving the button once more.

This time I want to move the button(dropdown as of 4.0.4) to the section header.
I tried to add the same code used in vbcms_page, ie {vb:raw toolbar} to the vbcms_content_section_page template just before the </h1> tag for the header. But this did nothing. So instead I copied the entire content of vbcms_toolbar and pasted this instead of {vb:raw toolbar}. Now I get the "Create New Article" text & dropdown where I want it but the dropdown box is empty :(.

Anyone able to help me out with this one?

I'm very new to template modifications so I'm not sure how it all connects and why I cant use {vb:raw toolbar} in that template and so on.

Lynne
19 Jun 2010, 15:56
All variables must be registered for use in the template you want to use them in. Cellarius wrote a really good article that you may be interested in - [vB4] Rendering templates and registering variables - a short guide (http://www.vbulletin.org/forum/showthread.php?t=228078)

Scitz0
19 Jun 2010, 22:53
All variables must be registered for use in the template you want to use them in. Cellarius wrote a really good article that you may be interested in - [vB4] Rendering templates and registering variables - a short guide (http://www.vbulletin.org/forum/showthread.php?t=228078)
Thanks for the answer but to be honest I didn't get much of that. As I said I'm very new to this, maybe if you could give an example of how to solve my problem above my brain will start to function properly.

Again thanks and I hope you or someone else can push me further in the right direction :)

Lynne
20 Jun 2010, 02:25
And example would be if you were using variable $whatever in an existing template this_template like so:
{vb:raw whatever}

Then before you could do so, you would have to pre-register it using a plugin:
vB_Template::preRegister('this_template', array('whatever' => $whatever));

Scitz0
20 Jun 2010, 08:29
Ok thank you, I think I get what your saying but I was thinking of a more specific exampel for my case. Still not sure how to preregister the vbcms_toolbar template in the vbcms_content_section_page template. I'm not even sure how vbcms_page preregister the vbcms_toolbar template in the default vb4 template. Can't find any preregistration of the vbcms_toolbar template anywhere.

I would really love if you could give me a hand in this specific case, maybe all the pieces fall into place after that.

Again, thank you for your effort.

Todo-F1
22 Jun 2010, 16:03
Ok thank you, I think I get what your saying but I was thinking of a more specific exampel for my case. Still not sure how to preregister the vbcms_toolbar template in the vbcms_content_section_page template. I'm not even sure how vbcms_page preregister the vbcms_toolbar template in the default vb4 template. Can't find any preregistration of the vbcms_toolbar template anywhere.

I would really love if you could give me a hand in this specific case, maybe all the pieces fall into place after that.

Again, thank you for your effort.

I have exactly the same problem. I hope someone can help us.