By pennywit on
OK ... times like this, I really wish I were a real programmer, rather than just a wooden boy.
OK .. I'm looking through the available PHP snippets, and I've found some that will get me node, with teasers from a specific taxonomy term. And I've found some that will get me a list of titles from a specific taxonomy term. Now, is there some way to meld the two concepts so that I generate the title and teaser from the most recent node in a term, followed by simple title (and author) links to, say, the next five?
I also wish I had a budget so I could hire a programmer to do this for me ...
--|PW|--
Comments
quick way of doing it....
You could combine the two snippets in the same page..i.e.
Snippet 1: ">Display (x) recent nodes (with teasers) of a specified type from a specified taxonomy term
And add this line in between:
The
unsetcommand essentially "clears" the $output results so one can have another php snippet creating output. more details are on the using more than one snippet in the same page handbook page.Snippet 2: Display a list of node titles from a specific category
Hope that helps
Dub
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
another (alternative) tip..
Hope the above is of use..if you run into difficulties, post back up here.
As another alternative approach..which doesn't require the
unsetthing mentioned earlier..print $output;line and rename the $output string to be called$output-topprint $output;line and rename the $output string name to be$output-list.Of course instead of a table..it could be a DIV or some custom formatting...I hope that makes sense and sparks a few ideas...
Dub
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
Try this:
It should work! :o)
Pobster
Gratitude
Hey, thanks! If it works, shall it be appended to the sliced bread snippets?
--|PW|--
If I might impose one more time ...
Sorry I'm such a moron about this ...
If I wanted to put in the author's name ahead of each listed node, how would I add in that?
--|PW|--
stumbled across this..
Hi Pennywit...
I stumbled across this earlier...click through to the fellowsrdvp.org site and have a look at the Most recent Blog entries on the front page..
They have the most recent weblog in teaser + author info, followed by the next 5 most recent weblog titles.. the Drupaller in charge of that site has typed up an explanation of how he did it in the Sliced Bread Snippets page of the Drupal handbook.
Hope that helps..
Dub
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
No problem! :o)
Oops sorry popped out to go shopping! Yeah no worries, sorry I didn't read your specs properly else I would have put the author in it the first time round. N'mind done now - here it is:
I've submitted it to the php snippets page already ;o) I like having a good presence there! BTW, I'm no programmer either hence how comes I only just found the command 'continue;' to loop the while erm... loop (!) back to the start rather than just recall the db query. Looks a lot nicer now :o)
Pobster