Jump to content

Adding fields to news_additem.tpl [SOLVED]


AGuyFawkesMask

Recommended Posts

Hi all,

I'm interested in modifying the news_additem.tpl file such that the subject field will display the subject, but also be a link at the same time. i.e. NOTAM: Electronic kneeboard technology now available in the Downloads section

I've added a field to my phpvms_news table called "redirect_link" and I've edited my news_newsitem.tpl such that it appears as follows:

<a href="<?php echo $redirect_link; ?>"><?php echo $subject; ?></a>

I added the following line to news_additem.tpl

<input type="text" name="redirect_link" value="<?php if(isset($newsitem->redirect_link)) { echo $newsitem->redirect_link; }?>" size="100%" />

I also added some lines to SiteCMS.php in the admin/modules folder. However, when the link is displayed on my site, it's not doing anything and is displaying the link to the page I'm currently on. Also, I see that the link is being placed in the body field in the phpvms_news table upon adding/editing a news item via the admin panel.

Can anyone guide me through which lines I need to add/edit in my SiteCMS.php file? I believe this is where the error is originating.

Thanks in advance.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...