That worked, to a point. The button stays with the text doing that, but, it introduces another problem.<br>In this theme, in the page template, the regions, including the one I'm using, are coded like this:<br><br> <?php print render($page['featured']) ?><br>
<br>and what happens is, after I create the output I want:<br><br> if (drupal_is_front_page()) {<br> global $my_theme_path;<br> $featured_image_path = $my_theme_path . '/files/frontpage_feature.png';<br>
drupal_add_css('div.region-featured {background-image: url(' . $featured_image_path . ')}', 'inline');<br> $vars['my_button'] = theme('button', array('element' => array('#attributes' => array('id' => 'my-button'), '#button_type' => 'button', '#value' => t('Test'))));<br>
$vars['feature'] = '<div id="my_wrapper"><div id="welcome">some text<div id="signup">' . $vars['my_button'] . '</div></div></div>';<br>
}<br><br>I then have the problem of trying to get it to print within the region. If I change the line to:<br><br> <?php print render($page['featured']) . $feature; ?><br><br>I get the above content printing, but without any markup for the 'featured' region, because this content does not get added to the region, and the region contains no other content, no markup appears for it.<br>
<br><div class="gmail_quote">On Wed, May 30, 2012 at 12:26 PM, Laura Scott <span dir="ltr"><<a href="mailto:pinglaura@gmail.com" target="_blank">pinglaura@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF"><div>Have you tried defining all the markup in template.php to be included in output, and simply calling the variable in your tpl?<span class="HOEnZb"><font color="#888888"><br><br><div>Laura Scott</div>
<div>via tablet</div></font></span></div><div><div class="h5"><div><br>On May 30, 2012, at 5:46 AM, Jeff Greenberg <<a href="mailto:listmail.ayendesigns@gmail.com" target="_blank">listmail.ayendesigns@gmail.com</a>> wrote:<br>
<br></div><div></div><blockquote type="cite"><div>So here is what I discovered. It is something that Drupal is doing in rendering. Here is an uncomplicated html example that works fine in a .html file<div><br></div><div><div>
<div style="position:relative"></div>
<div> <div style="position: absolute;top:100;"></div><div> This is a test</div><div> <input type="button" value="test" /></div><div> </div></div><div></div></div>
<div><br></div><div>In Drupal, my outer div is the region, which I mark as relative positioning in the css. The inner div is a block, which I mark as absolute positioning in the css. The block appears correctly. The button, whether I create it via $mybutton=theme(button), or create it via $mybutton="<input type=button>, I have tried printing the variable from the template and inside the block, and the markup always ends up like this:</div>
<div><br></div><div><div></div><div> <div></div><div> block stuff</div><div> </div></div><div></div></div><div><input></div><br><div class="gmail_quote">On Tue, May 29, 2012 at 8:27 AM, Carl Wiedemann <span dir="ltr"><<a href="mailto:carl.wiedemann@gmail.com" target="_blank">carl.wiedemann@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Global variables are not necessary and should be avoided.<div><br></div><div>Does it *visually* appear outside of the enclosing divs, or are you talking strictly about the markup? The former could indicate a mere CSS error.</div>
<div><br></div><div>Consider providing a pastebin of both the preprocess and markup to help diagnose.<br clear="all"><div><br></div><font color="#333333">Carl Wiedemann</font><div><div><font color="#666666">Website design & development consulting | <a href="http://c4rl.ws" target="_blank">c4rl.ws</a></font></div>
<div><font color="#666666"><a href="mailto:carl.wiedemann@gmail.com" target="_blank">carl.wiedemann@gmail.com</a> | skype: c4rlww</font></div></div><br>
<br><br><div class="gmail_quote"><div><div>On Mon, May 28, 2012 at 9:50 PM, Jeff Greenberg <span dir="ltr"><<a href="mailto:listmail.ayendesigns@gmail.com" target="_blank">listmail.ayendesigns@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>In D7, in template.php, I'm hooking preprocess_page and setting a $vars[] variable = theme_button. <div>
<br></div>
<div>In a block, I have this:</div><div><br></div><div><?php global $signup_button; ?></div><div>
<div><div id="signup"><?php print $signup_button; ?></div></div></div><div><br></div><div>The button appears in the page source outside of those enclosing divs. What am I doing wrong?</div><div>
<br></div>
<br></div></div>_______________________________________________<br>
themes mailing list<br>
<a href="mailto:themes@drupal.org" target="_blank">themes@drupal.org</a><br>
<a href="http://lists.drupal.org/mailman/listinfo/themes" target="_blank">http://lists.drupal.org/mailman/listinfo/themes</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
themes mailing list<br>
<a href="mailto:themes@drupal.org" target="_blank">themes@drupal.org</a><br>
<a href="http://lists.drupal.org/mailman/listinfo/themes" target="_blank">http://lists.drupal.org/mailman/listinfo/themes</a><br>
<br></blockquote></div><br></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>themes mailing list</span><br><span><a href="mailto:themes@drupal.org" target="_blank">themes@drupal.org</a></span><br>
<span><a href="http://lists.drupal.org/mailman/listinfo/themes" target="_blank">http://lists.drupal.org/mailman/listinfo/themes</a></span><br></div></blockquote></div></div></div><br>_______________________________________________<br>
themes mailing list<br>
<a href="mailto:themes@drupal.org">themes@drupal.org</a><br>
<a href="http://lists.drupal.org/mailman/listinfo/themes" target="_blank">http://lists.drupal.org/mailman/listinfo/themes</a><br>
<br></blockquote></div><br>