Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By apt94jesse on
I'm trying to get a page per user that shows either the teaser or full node for a specific content type.
Practical application: I'm using the embed module for embedding youtube videos. I'd like for each user to be able to publish 5 embdedded video nodes. I believe I'm using noderestrict to determine the amount of nodes a user can publish of a certain content type. Now I just need to generate a page for each user.
Any direction is appreciated.
-Jesse
Comments
Bump... anyone. I'm
Bump... anyone.
I'm interested as well.
Here's how I solved this
I just came up with this solution, so there may be a kink or two to work out.
I have created a content type called content_video with cck. Then I used this snippet in a page node set to php input:
The line
$usernumber=$_REQUEST['usernumber'];
draws out a variable from the url, so on my site I use /video?usernumber=1
This sets $usernumber to 1 and therefore shows all videos by user number 1.
Then in my templated profile page I have a link as follows:
This inserts the users's uid into the url and passes said variable into the page node, dynamically loading that user's video nodes.
Like I said, works for me so far, probably some tweaking to get it perfect. You can also limit the amount of video nodes a user can create by using (I think) the noderestrict module, if you want to put limits on the # of videos someone can have.
Oh, by the way, the video content type just uses a text field where you paste youtube embed code into. Then set the input type to html, activate the embedfilter module, and your site will play the youtube videos, without taking up your bandwidth or storage space.