Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I have created a page that displays the latest news. On the right side of the page using context module i have placed a "Recent news" block (Created using views). The recent news block shows 4 recently created news. I have added a "link" field in each item to show "Read more" on the block.

I have created another page using views which displays the complete news created so far. I call this as news archive. My problem is i have to create a "To news archive" menu in the "Recent block" last line.

enter image description here

share|improve this question

2 Answers

You have created a view for recent news. Just add a footer to the view and then implement php l() function for your menu in the global text area of the footer.

share|improve this answer
Thanks a lot somya. It worked:) – Slasengger Apr 11 '12 at 7:01
Be warned however that storing php code in database is a discouraged practice. I'm placing my answer. – Artur Jul 3 '12 at 14:35

You might try to use a Views theming technique.

  1. On the advanced pane of your view, click Theme information and pick one of the "Display output".
  2. Paste the php code into a blank php file and place it in the YOUR_THEME/templates directory
  3. Add the code you used at the bottom of the template or at any part of the view that suits you.
  4. Press the Rescan template files button in the Theme information dialog
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.