PDA

View Full Version : Please help! Adding Custom Field to CMS article


FunnyMan
01-06-2011, 02:12 AM
Hi,

I would like to add two custom fields to CMS article. Read about hook feature in different articles. If i get some guidence on how to write a plugin or hook to add new fields would be very helpful.

Please note that i am new to vb coding, so any help would be really great :)

--------------- Added 1294315725 at 1294315725 ---------------

Lynne, you have helped many with your answers. can you please help me with this one?

or any other expert? please guide me in the right direction to make this change.

appreciate your help :)

FunnyMan
01-07-2011, 12:43 PM
can someone help me on this? thank you :)

Lynne
01-07-2011, 04:28 PM
What do you mean by new fields - like User Profile Fields to show something from the user? Or like new fields to the article? Have you looked at the mods yet?

FunnyMan
01-07-2011, 05:50 PM
What do you mean by new fields - like User Profile Fields to show something from the user? Or like new fields to the article? Have you looked at the mods yet?

Lynne, thank you very much for your attention on this.

I would like to add two new fields to the article:

1) External URL Link - This will be used in the <a href={}> on the article preview title. When the user click on the title header, they would be directly sent to the external url (deal link). I am running the deal site and it is very much needed (currently when the user clicks on the header it will open the article page and i don't want to do that for user friendly purposes)

2) Expired/Active Status - This field will be displayed next to the title in the article preview. If the deal is expired the status needs to changed.

Hope i have given you the detail...let me know if any further information needed...I did looked into the Mods, but couldn't find the one for my need.

Appreciate your help on this. :)

Lynne
01-07-2011, 06:39 PM
I can't tell you specifics since I haven't done this. But, you are going to want to be familiar with the cms_article table (maybe add a couple fields?) and then look at the code for content.php where the method is addcontent. You'll probably have to add your two new fields to an array so you can use the datamanager to add the content of those fields to the database.

FunnyMan
01-09-2011, 02:03 PM
Lynne, thank you...did figured it out....

HouseAddict
01-20-2011, 08:26 PM
It would be cool if someone could make this into a mod of some sort, so we don't have to hack the core files... as I am really looking to add some custom fields to CMS articles like that too!

Yellow Slider
01-20-2011, 08:47 PM
It would be cool if someone could make this into a mod of some sort, so we don't have to hack the core files... as I am really looking to add some custom fields to CMS articles like that too!

afaik, you have to edit a core file in order to add custom fields to the cms.

HouseAddict
01-21-2011, 10:20 PM
I can't tell you specifics since I haven't done this. But, you are going to want to be familiar with the cms_article table (maybe add a couple fields?) and then look at the code for content.php where the method is addcontent. You'll probably have to add your two new fields to an array so you can use the datamanager to add the content of those fields to the database.

Lynne, thank you...did figured it out....

FunnyMan, could you post the steps you took to get this handled? I am lost... not sure which file to even look for here and what to add...

Thanks!

FunnyMan
01-22-2011, 12:29 PM
hi,

you could start with "vbcms_content_article_inline" template edit.

add the fields that you may want and then search for the existing field by name into the source files.

you may get 3 or 4 files that you need to edit in order to make this thingwork. also you need to add fields in the database table cms_article.

hope this helps.

good luck!

Mark4865
01-22-2011, 01:04 PM
It would be great to get additional options as standard in the CMS set up without having to try and make changes that technical idiots like myself cannot risk doing.

Lynne
01-22-2011, 03:51 PM
Thans to Yellow Slider for this article - How to add a new field to the CMS (https://vborg.vbsupport.ru/showthread.php?t=257589)

charlesr
05-03-2012, 08:45 AM
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.

brandondrury
07-30-2012, 08:48 PM
I can't spend time manually making new fields in the database - the long term implications are just too tricky.
I agree 100%. I can tell you that in April of 2014 I won't have a clue on what code I need to change when none of my premium members can log in to what they have payed for because of a vb update.

This needs to be done on the vBulletin side the same way it works with profiles. At least, that would be worth a ton to me.

Brandon