<div><div>Victor, <br></div><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">If you would like to customize the theming of a view, use the "theming wizard".
</blockquote><div><br>I'm not trying to theme a view. That's easy enough to do. My problem is that there is a graphical element in page.tpl.php which changes depending on the webpage (which is defined via a cck field on the node).
<br></div> </div><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">It generates 3 pieces of code, namely code to insert into template.php</blockquote>
<div><br>Thats kind of the problem. The view is generated and inserted into the $content variable. So at the hook=page level, I can't access any of the properties of the nodes included in the view.<br><br><br><br>-john
<br></div><br><br><div><span class="gmail_quote">On 10/5/07, <b class="gmail_sendername">Victor Kane</b> <<a href="mailto:victorkane@gmail.com">victorkane@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
If you would like to customize the theming of a view, use the "theming wizard".<br><br>It generates 3 pieces of code, namely code to insert into template.php (generates the necessary variables and a callback function which invokes the php template file), a php template file which generates the semantic html for the view, and a css file.
<br><br>Alternatively, you can invoke the view programatically in the page php template file, either with op "embed" to just insert the view somewhere on the page, or as "item" (see views_build_views comments in
views.module), which will send you a hash of data which you can use as you like.<br><br>The best views documentation can be found in the handbooks here:<br><br><a href="http://drupal.org/node/109604" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://drupal.org/node/109604
</a><br><br>It includes tutorials and is worth going over with a fine toothcomb.<br><br>If you spend a day or so going over this documentation, you will be well-equipped to solve your problem using a variety of methods, and you will have a better foundation for future projects, rather than just seeking a quick fix.
<br><br>saludos,<br><span class="sg"><br>Victor Kane<br><a href="http://awebfactory.com.ar" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://awebfactory.com.ar</a></span><div><span class="e" id="q_1157042d62242a19_2">
<br><br><div><span class="gmail_quote">On 10/5/07, <b class="gmail_sendername">John Barreiros</b> <<a href="mailto:johnbarreiros2@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
johnbarreiros2@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thanks for the note Sean.<br><br>I do create a custom body class which corresponds to the page, but I'm not sure that will help me. All is well when working with and viewing a single node. I can define the image and it displays nicely in the upper right corner. But, when I'm viewing a view, there doesn't seem to be a way to define the image to display in that upper right corner.
<br><span><br>-John</span><div><span><br><br><div><span class="gmail_quote">On 10/4/07, <b class="gmail_sendername">Sean Robertson</b> <<a href="mailto:seanr@ngpsoftware.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
seanr@ngpsoftware.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
You can get around that using CSS. Assuming you've placed the image in<br>div#image set #news div#image img {display:none;} and then #news<br>div#image {background:...}. I've got php code that will assign and ID
<br>and classes to the body tag based on which page you're on if you need<br>help with that part of it.<br><br><br><br>John Barreiros wrote:<br>> Thanks for the response Larry. I'm trying to wrap my head around your
<br>> solution, which for the most part makes sense. My only question is, does<br>> it work if you're viewing a "view" page? For example, I navigate to the<br>> "news" page which is just a view displaying the last 10 news nodes. Will
<br>> the sidebar block display an image?<br>><br>> thanks again.<br>><br>> On 10/4/07, *Larry Garfield* <<a href="mailto:larry@garfieldtech.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
larry@garfieldtech.com</a><br>> <mailto:<a href="mailto:larry@garfieldtech.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
larry@garfieldtech.com</a>>> wrote:<br>><br>> Funny you should mention it. I just got around to documenting the<br>> way we<br>> tackle this issue at Palantir today:<br>><br>> <a href="http://drupal.org/node/180852" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://drupal.org/node/180852</a><br>><br>> As for the Views, create a node type that has nothing but a title and<br>> Viewfield CCK type. Create a node of that type and specify the View<br>> to use.
<br>> Tada, you have a node. Note: Doesn't work with dynamic arguments,<br>> sadly. :-(<br>><br>> Cheers.<br>><br>> On Thursday 04 October 2007, John Barreiros wrote:<br>> > Hi All.
<br>> ><br>> > This particular site I'm building features a layout with a photo<br>> in the<br>> > upper right corner. The client wants to have the ability to<br>> specify the
<br>> > image on every single page. I know I know, kind of whacked, but<br>> it's what<br>> > they want.<br>> ><br>> > So, first step was to use cck to add a new field to the "page"
<br>> type. I<br>> > tried imagefield but didn't like how you couldn't select an<br>> existing image.<br>> > I managed to whip together a new cck field which uses IMCE to<br>> select the
<br>> > image (I'll up it to cvs after some more testing and some<br>> coworkers give me<br>> > the thumbs up on its quality).<br>> ><br>> > Okay, so that takes care of any pages displaying a single node.
<br>> ><br>> > How do I handle views? There are a few views and they obviously<br>> need to<br>> > have the image customizable. It'd be nice if when creating a<br>> "view" to
<br>> > provide a page, it inherited the cck fields from the "page" type.<br>> ><br>> > Could I use form_alter to add the cck field to the views form?<br>> ><br>> > Or is there some way when the "view" is being built I can extract
<br>> the image<br>> > from the first node and pass it to page.tpl.php?<br>> ><br>> > Any help would be appreciated. Thanks in advance.<br>> > -john<br>><br>><br>> --
<br>> Larry Garfield AIM: LOLG42<br>> <a href="mailto:larry@garfieldtech.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">larry@garfieldtech.com</a> <mailto:<a href="mailto:larry@garfieldtech.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
larry@garfieldtech.com</a>> ICQ:
<br>> 6817012<br>><br>> "If nature has made any one thing less susceptible than all others of<br>> exclusive property, it is the action of the thinking power called an<br>> idea,<br>> which an individual may exclusively possess as long as he keeps it to
<br>> himself; but the moment it is divulged, it forces itself into the<br>> possession<br>> of every one, and the receiver cannot dispossess himself of it." --<br>> Thomas<br>> Jefferson
<br>><br>><br><br>--<br>Sean Robertson<br>Web Developer<br>NGP Software, Inc.<br><a href="mailto:seanr@ngpsoftware.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">seanr@ngpsoftware.com</a>
<br>(202) 686-9330<br><a href="http://www.ngpsoftware.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.ngpsoftware.com
</a><br></blockquote></div><br>
</span></div></blockquote></div><br>
</span></div></blockquote></div><br>