The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
How to add a new field to the CMS
- Apply the changes mentioned in this how-to at your own risk. - You must have a basic understanding of php, html and vbulletin. - This is a how-to for vb4.1, and may not work on previous versions. Everywhere you see FIELDNAME, replace it with your field name (must not contain spaces). 1. Create a new field in the cms_node table. 2. If you run vB 4.1.9 or lower , open packages\vbcms\item\content.php and find: PHP Code:
PHP Code:
3. Go to the template vbcms_edit_publisher. At the bottom of the template, before these lines: HTML Code:
</div> <div style="clear:both"></div> HTML Code:
<div class="blockrow" > <label class="thirdleft">FIELD TITLE</label> <div class="twothirdsright"><input type="text" size="30" value="{vb:raw FIELDNAME}" name="FIELDNAME" tabindex="1" class="textbox fullwidth" /></div> </div> Go to your ACP --> Plugins & Products --> Add New Plugin. Hook Location: vbcms_article_save_start. PHP Code: PHP Code:
The following steps have been written by Lynne, thank you 5. To get the field to spit out, you must add it to the vbcms_content_article_page somewhere (this is rough, you'll have to add your own class/styling). HTML Code:
<div>Custom Field:{vb:raw FIELDNAME}</div> PHP Code:
PHP Code:
PHP Code:
PHP Code:
That's it, you're done. |
#12
|
|||
|
|||
hey Yellow
cant you please check you PM inbox - you qouta is up and the reply you asked me for cannot be sent to you |
#13
|
|||
|
|||
I can't manage to make this to work, I've made everthing it says in here but when I put the data into the fields and push SAVE I get this error
Code:
Invalid SQL: UPDATE for_cms_node SET url_prod = 'test1', url_image = 'test2', WHERE nodeid = 21; MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE nodeid = 21' at line 4 Error Number : 1064 |
#14
|
||||
|
||||
That's because you have a comma right before the WHERE line which isn't supposed to be there.
|
#15
|
|||
|
|||
The problem it is as you said a comma, thank you verry much for the help. Now i have the same problem as HouseAddict, the date is inserted into the database but is not spit out on the article page. Can you help me fix that problem too ?
Thanks again for the help. |
#16
|
||||
|
||||
I haven't any need for adding a new field to my CMS, so I haven't looked into this in anyway past what I posted for Yellow Slider.
|
#17
|
|||
|
|||
I've tried the exact example and the date still isn't spit out in the article page.
|
#18
|
|||
|
|||
Hi lynne,
I have the same problam, I managed to save it but not to spit it out. I didn't quiet understood number 5 - To get the field to spit out, you must add it to the vbcms_content_article_page somewhere (this is rough, you'll have to add your own class/styling). HTML Code: <div>Custom Field:{vb:raw FIELDNAME}</div> I have added <p>{vb:raw articlesource}</p> and nothing.. any help? |
#19
|
|||
|
|||
I'm desperate for custom article fields and ways to manage the CMS better - if this existed, it would make the CMS amazing. Currently I'd just describe the CMS as functional, albeit simple and easy to use.
Anyone else reading this thread, please vote and watch and comment here: http://tracker.vbulletin.com/browse/VBIV-10048 We have spent a lot of time making the VB4CMS look fantastic, and now just need it to BE fantastic! I can't spend time manually making new fields in the database - the long term implications are just too tricky. |
#20
|
|||
|
|||
Quote:
Could someone explain? Is this something I do in the control panel? Do I need to create a plugin? Modify a template? |
#21
|
|||
|
|||
Quote:
These instructions involve manually modifying the database and editing vb files as well as template modifications and creating plugins. It took me a bit to understand that the first step is to add a column to the cms_node table in the database (could probably use some clarification there). |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|