Hello, this is a simple question I believe.
I've taken a pause from trying to figure out how to get variable name outputs and instead I am focusing on a more feature I'd like to get working.
I'm struggling with finding good documentation, and the drupal.org documentation seems very fragmented -- maybe it's just me, but I can't seem to find out what the best approach is for the following:
I have a view set up which displays nodes of a certain taxonomy. I have customized which fields are present and themed them all just fine.
Now I want to have it so that if a user clicks the attached image, or the title of the node [or a link in the body of the content] that the user goes to a new page that displays another view of JUST this one node. Preferably I'd like to have control over the view of the single-node view, just like I have control over the taxonomy-filtered view I have already made.
Since I need to turn on 'link image to node' and 'link title to node', this makes Drupal open the node's page, example: ?q=node/27
So how can I redirect or capture this 'click' and have the user see a view of JUST node 27 when they click a title, formatted and displaying only the fields I declare in a view?
I am aware that there are tpl.php files for nodes and node-types; but I'm not sure that this is the right way to go...?
So, my question is one of approach: how would I go about doing this? capturing from the view, or by patching up a tpl.php file?
Please remember I am a total Drupal 6 newbie... so please don't assume I know much... This is my first website in drupal; I'm quite good at CSS, and an expert in (object orientated) Actionscript/Flash; but a total newbie in PHP and Drupal.
So thank you in advance for your patience and assistance!
Kind,
Sebastian.
On Thu, Apr 9, 2009 at 3:06 PM, sebastian inforazor@gmail.com wrote:
I am aware that there are tpl.php files for nodes and node-types; but I'm not sure that this is the right way to go...?
For changing the appearance of single node or type of node you want to edit the template files. You'd probably want to edit node-[your content type].tpl.php or if you only want to style a single node, you can do node-[nid].tpl.php.
I haven't fiddled with theming D6, but you might have to clear your theme cache.
I agree, theming the node probably makes more sense than showing a View of one page and theming the View (related content might be a reason to want to do this, though). If you do want to have a View of just one node, you could use the Arguments option to pass the NID to your view and have it just show that one node.
Brian
On Thu, Apr 9, 2009 at 3:10 PM, Justin Gruenberg <justin.gruenberg@gmail.com
wrote:
On Thu, Apr 9, 2009 at 3:06 PM, sebastian inforazor@gmail.com wrote:
I am aware that there are tpl.php files for nodes and node-types; but I'm not sure that this is the right way to go...?
For changing the appearance of single node or type of node you want to edit the template files. You'd probably want to edit node-[your content type].tpl.php or if you only want to style a single node, you can do node-[nid].tpl.php.
I haven't fiddled with theming D6, but you might have to clear your theme cache. _______________________________________________ themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
Hello Brian [others] thank you so much for your input, and pointing me the way of arguments.
If I were to go down the Views' path, how would I do this? If a user clicks the title, they get sent to the Node, not to a View; how can I make it so that the user sees the View, with the correct NID, instead of the Node's default [non-Views] page? Am I forced to hand-code the title/image links to something other than the default [links to Node NID]? If so, how would I do that?
I'd like to figure that out even if I do end up theming the node tpl instead,
Thanks for any insight you or anyone might be able to offer,
Cheers,
Sebastian.
Brian Choc wrote:
I agree, theming the node probably makes more sense than showing a View of one page and theming the View (related content might be a reason to want to do this, though).
If you do want to have a View of just one node, you could use the Arguments option to pass the NID to your view and have it just show that one node.
Brian
On Thu, Apr 9, 2009 at 3:10 PM, Justin Gruenberg <justin.gruenberg@gmail.com mailto:justin.gruenberg@gmail.com> wrote:
On Thu, Apr 9, 2009 at 3:06 PM, sebastian <inforazor@gmail.com <mailto:inforazor@gmail.com>> wrote: > > I am aware that there are tpl.php files for nodes and node-types; but I'm > not sure that this is the right way to go...? For changing the appearance of single node or type of node you want to edit the template files. You'd probably want to edit node-[your content type].tpl.php or if you only want to style a single node, you can do node-[nid].tpl.php. I haven't fiddled with theming D6, but you might have to clear your theme cache. _______________________________________________ themes mailing list themes@drupal.org <mailto:themes@drupal.org> http://lists.drupal.org/mailman/listinfo/themes
themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
On Thu, Apr 9, 2009 at 11:32 PM, sebastian inforazor@gmail.com wrote:
If I were to go down the Views' path, how would I do this? If a user clicks the title, they get sent to the Node, not to a View; how can I make it so that the user sees the View, with the correct NID, instead of the Node's default [non-Views] page? Am I forced to hand-code the title/image links to something other than the default [links to Node NID]? If so, how would I do that?
I'd like to figure that out even if I do end up theming the node tpl instead,
If you were to use views to do this you'd need to set up an entirely new view. You would need to use arguments from the URL to specify what node you want to display (probably the node id). You would have to build a link to this view in your taxonomy view. You would then be able to theme your new view . . . and you'd be exactly where you're at right now if you just theme the node page.
Unless I'm misunderstanding your question, doing this in views would just reimplement what drupal already does.
Your best bet is to make a node template. You can use the existing node.tpl.php as an example. Also, if you look at the api docs ( http://api.drupal.org/api/file/modules/node/node.tpl.php/6 ) you can see all the variables that will be in scope. I'd also suggest using the Devel module ( http://drupal.org/project/devel ) which is like FireBug for drupal and it'll show you what files to create/modify to theme just about anything in drupal.
Wow, the Devel module is excellent! Thanks!!! Phew, finally feeling like I am able to make progress now! Not solved but now I am finally able to move forward again. :D
I am heeding your advice on making a node-product_module.tpl.php file, and this is now going in the right direction [now that I finally could see where the node.tpl.php file that was being used was!!]
Thank you!!
Sebastian.
Justin Gruenberg wrote:
On Thu, Apr 9, 2009 at 11:32 PM, sebastian inforazor@gmail.com wrote:
If I were to go down the Views' path, how would I do this? If a user clicks the title, they get sent to the Node, not to a View; how can I make it so that the user sees the View, with the correct NID, instead of the Node's default [non-Views] page? Am I forced to hand-code the title/image links to something other than the default [links to Node NID]? If so, how would I do that?
I'd like to figure that out even if I do end up theming the node tpl instead,
If you were to use views to do this you'd need to set up an entirely new view. You would need to use arguments from the URL to specify what node you want to display (probably the node id). You would have to build a link to this view in your taxonomy view. You would then be able to theme your new view . . . and you'd be exactly where you're at right now if you just theme the node page.
Unless I'm misunderstanding your question, doing this in views would just reimplement what drupal already does.
Your best bet is to make a node template. You can use the existing node.tpl.php as an example. Also, if you look at the api docs ( http://api.drupal.org/api/file/modules/node/node.tpl.php/6 ) you can see all the variables that will be in scope. I'd also suggest using the Devel module ( http://drupal.org/project/devel ) which is like FireBug for drupal and it'll show you what files to create/modify to theme just about anything in drupal. _______________________________________________ themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
As a follow up to the wonders of Devel, I've identified a function called:
theme_text_formatter_plain()
Which devel could not tell me where it was located... :(
After some hunting on google, I found that it was in:
/cck/modules/text/text.module
Is it also possible to override the PHP code in a module? When I try and do so by using:
mythemename_text_formatter_plain() in the mythemename/template.php file, nothing happens... [ie it still runs the text.module code's version of the function]
taking a step back, what I am trying to do should be very simple... I have a cck/text field, i have fckeditor installed. I want the webadmin to be able to insert HTML like content into it, and have it displayed as HTML.
Unfortunately the text field's properties [under content-type, edit, display fields, manage] do not offer HTML output, I only see:
* Plain text * Filtered text
If I select Filtered text, I get an error on the content-creation page for the content type in question.
If I select plain text, it converts all of the html to its HTML-safe escape characters...
If I click 'display fields' sub tab in the content-type's sub edit pages, I see in the drop down: 'default', 'plain text' and 'hidden'. default and plain result in no chance of the output.
How can I stop the text field from converting the input into 'plain' or 'safe'?
Thanks again,
Sebastian.
sebastian wrote:
Wow, the Devel module is excellent! Thanks!!! Phew, finally feeling like I am able to make progress now! Not solved but now I am finally able to move forward again. :D
I am heeding your advice on making a node-product_module.tpl.php file, and this is now going in the right direction [now that I finally could see where the node.tpl.php file that was being used was!!]
Thank you!!
Sebastian.
Justin Gruenberg wrote:
On Thu, Apr 9, 2009 at 11:32 PM, sebastian inforazor@gmail.com wrote:
If I were to go down the Views' path, how would I do this? If a user clicks the title, they get sent to the Node, not to a View; how can I make it so that the user sees the View, with the correct NID, instead of the Node's default [non-Views] page? Am I forced to hand-code the title/image links to something other than the default [links to Node NID]? If so, how would I do that?
I'd like to figure that out even if I do end up theming the node tpl instead,
If you were to use views to do this you'd need to set up an entirely new view. You would need to use arguments from the URL to specify what node you want to display (probably the node id). You would have to build a link to this view in your taxonomy view. You would then be able to theme your new view . . . and you'd be exactly where you're at right now if you just theme the node page.
Unless I'm misunderstanding your question, doing this in views would just reimplement what drupal already does.
Your best bet is to make a node template. You can use the existing node.tpl.php as an example. Also, if you look at the api docs ( http://api.drupal.org/api/file/modules/node/node.tpl.php/6 ) you can see all the variables that will be in scope. I'd also suggest using the Devel module ( http://drupal.org/project/devel ) which is like FireBug for drupal and it'll show you what files to create/modify to theme just about anything in drupal. _______________________________________________ themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
On Fri, Apr 10, 2009 at 2:12 PM, sebastian inforazor@gmail.com wrote:
As a follow up to the wonders of Devel, I've identified a function called: mythemename_text_formatter_plain() in the mythemename/template.php file, nothing happens... [ie it still runs the text.module code's version of the function]
You have to clear the theme cache. Check: http://drupal.org/node/173880#theme-registry -- although it seems like your problem is just with the input format, and you probably do not need to override any theme functions for your problem.
How can I stop the text field from converting the input into 'plain' or 'safe'?
This is a problem with input formats. You're using a WYSIWYG editor, which is going to output HTML to Drupal. You need to set your input format (usually right under the field in your node/add form) to Full HTML. I'm not sure about your specific case.
Ok I finally was able to see the input for 'full or filtered html' when I changed my admin theme for content to garland... hmmm;
Thanks for all your help on this one. :)
Sebatian.
Justin Gruenberg wrote:
On Fri, Apr 10, 2009 at 2:12 PM, sebastian inforazor@gmail.com wrote:
As a follow up to the wonders of Devel, I've identified a function called: mythemename_text_formatter_plain() in the mythemename/template.php file, nothing happens... [ie it still runs the text.module code's version of the function]
You have to clear the theme cache. Check: http://drupal.org/node/173880#theme-registry -- although it seems like your problem is just with the input format, and you probably do not need to override any theme functions for your problem.
How can I stop the text field from converting the input into 'plain' or 'safe'?
This is a problem with input formats. You're using a WYSIWYG editor, which is going to output HTML to Drupal. You need to set your input format (usually right under the field in your node/add form) to Full HTML. I'm not sure about your specific case. _______________________________________________ themes mailing list themes@drupal.org http://lists.drupal.org/mailman/listinfo/themes
If you were to use views to do this you'd need to set up an entirely new view. You would need to use arguments from the URL to specify what node you want to display (probably the node id). You would have to build a link to this view in your taxonomy view. You would then be able to theme your new view . . . and you'd be exactly where you're at right now if you just theme the node page.
Unless I'm misunderstanding your question, doing this in views would just reimplement what drupal already does.
Hiya, well, one reason for wanting to use Views to display a node is so that I don't have to re-style all of the horrendous levels of CSS depth all over again to make the detail [node] page look the same as my taxonomy-filtered view...
I've started theming the Node view, now that I can affect the output, and the styling with the CSS is taking hours; and yes, I am using Firebug for firefox; The entire topology of class names and ID's are different in the standard node output than in the standard View of nodes... could in part be due to my own oversight of the CSS-topology-logic employed, but still... sigh. :(
Setting up a new View would probably only take me 15 min as that is at least straight forward, and I can mimic the CSS output exactly... not to mention use a 'Page' so that I can retain taxonomy links in a different column; But I still didn't understand from your description how I would "build a link to this view in my taxonomy view"? How do I link to a View and pass an argument instead of to a nodes NID page?
Thanks for your help,
Sebastian