PDA

View Full Version : Is there another way to write the header?


dreamingdigital
09-01-06, 05:39 PM
Is <mvt:item name="prod_ctgy_hdft" param="prod_header" /> the only way to write the product header to the screen? If so, how would I do an if/else on it?

lfreeman
09-01-06, 07:31 PM
You don't need to apply a conditional to that statement, just build your conditionals within the headers themselves.

dreamingdigital
09-01-06, 07:39 PM
Thanks for the reply. :)

I want a conditional that sees if there is actually anything in the header because if not I want to display a fallback section of code. :)

CP

lfreeman
09-01-06, 08:24 PM
If there's nothing in the header, it doesn't display anything? That's why I said to use the header itself. Maybe I am confused, easy to do lately.

I just thought it would be easier to use your IF/Then in the header for particular instances rather than replacing the statement. Maybe someone else will chime in with a solution for you.

dreamingdigital
09-01-06, 09:25 PM
Yup. If nothing is in the header nothing gets displayed. I'm using the header part on the side navbar to have additional support info, seo keywords, etc... there is fancy formatting around it so it appears in a nice box. While our store is being built and updated I want to display a default section in the place to where the header is going if there isn't anything in the header. Like a fallback thing. I guess this is what I could do:

===================
<div style="position:absolute; visibility:hidden; top:-500px; left:1px">
<form name="my_textarea_header">
<textarea name="product_header_content" rows="4" cols="30"><mvt:item name="prod_ctgy_hdft" param="prod_header" /></textarea>
</form>
</div>

<script type="text/javascript">
var my_prod_header = document.my_textarea_header.product_header_content .value;
var my_fallback_header = "bla bla something too big to write here";
if (my_prod_header.length>5) {
document.write(my_prod_header);
}
else {
document.write(my_fallback_header);
}
</script>
========================

that would most likely work OK but....... it throws any SEO out the window since search engines aren't looking at my javascript and I doubt they care about the default conent in a textarea. being able to do it just using miva would be the best!!