1
mixmaster
{$xoops_imageurl} Problem
  • 2005/1/24 2:14

  • mixmaster

  • Just popping in

  • Posts: 28

  • Since: 2005/1/21


I have a simple question about using {$xoops_imageurl}

The following code works with no problem:
<td width="##" height="##" style="background-image: 
url(http://www.mysite.com/xoops/themes/mytheme/image.jpg); 
background-repeat: no-repeat;"
>&nbsp;</td>


But this won't work?

<td width="##" height="##" style="background-image: 
url([color=33CC33]<
{$xoops_imageurl}>image.jpg[/color]); 
background-repeat: no-repeat;"
>&nbsp;</td>


How do I get this to work????

2
tjnemez
Re: {$xoops_imageurl} Problem
  • 2005/1/24 2:32

  • tjnemez

  • Home away from home

  • Posts: 1594

  • Since: 2003/9/21


Quote:
<td width="##" height="##" style="background-image:
url(<{$xoops_imageurl}>image.jpg);
background-repeat: no-repeat;">&nbsp;</td>


<td width="##" height="##"><div style="background-image:
url(<{$xoops_imageurl}>image.jpg);
background-repeat: no-repeat;"></div></td>

or

theme.html

<td id="whatever">&nbsp;</td>

style.css

#whatever {
background-image: url(<{$xoops_imageurl}>image.jpg);
background-repeat: no-repeat;
height: 0px
width: 0px
}

3
mixmaster
Re: {$xoops_imageurl} Problem
  • 2005/1/24 2:52

  • mixmaster

  • Just popping in

  • Posts: 28

  • Since: 2005/1/21


I just did as you suggested and got the same exact result as I had before. It made no difference. It seems that {$xoops_imageurl} doesn't work inside background-image: url(); . Can anyone confirm this? Or do you have any other suggestions? Thanks in advance.

4
AAINC
Re: {$xoops_imageurl} Problem
  • 2005/1/24 3:06

  • AAINC

  • Not too shy to talk

  • Posts: 121

  • Since: 2003/10/18


Here is the code from the ArchSilver theme, for the left blocks. xoops_imageurl does work in td background using html.

<{foreach item=block from=$xoops_lblocks}>
<
table border="1" bordercolor="silver" style="border-collapse: collapse" cellpadding="1" cellspacing="1" bgcolor="#000000" width="150">
<
tr>
<
td bgcolor="000000" valign="top">
<
table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#000000">
<
tr>
<
td valign="top" bgcolor="#000000" cellpadding="4" cellspacing="4">
<
table border="0" cellpadding="0" cellspacing="0" width="100%" height="23" bgcolor="#000000">
<
tr>
<
td background="<{$xoops_imageurl}>images/b1.gif" width="16" height="23">
<
td width="116" height="23" background="<{$xoops_imageurl}>images/b2.gif" class="blockTitle">&nbsp;<{$block.title}>
<
td background="<{$xoops_imageurl}>images/b3.gif" width="26" height="23">
</
td>
</
tr>
</
table>
<
table cellspacing="0" cellpadding="0" width="100%" height="100%">
<
tr>
<
td background="<{$xoops_imageurl}>images/f.gif" class="blockContent"><{$block.content}>
</
td>
</
tr>
<
tr>
<
td height="23" background="<{$xoops_imageurl}>images/u3.gif" width="100%">
</
td>
</
tr>
</
table>
</
td>
</
tr>
</
table>
</
td>
</
tr>
</
table>
<
br>
<{/foreach}>


try this

<td width="##" height="##" background="<{$xoops_imageurl}>images/image.jpg"nbsp;</td>

5
LazyBadger
Re: {$xoops_imageurl} Problem

Forot about absolute URLs and don't use this smarty variable
style for image in theme's folder
td#headerbar {
border-bottom: 0px solid #dddddd;
background-image: url(hbar.gif);
}

style for image in images subfolder inside themefolder
input[type="button"] {
background-color: #eaeef2;
border: #000 1px solid;
color: #fff;
font: 10px verdana, tahoma, arial, helvetica, sans-serif;
text-align:center;
background-image : url(images/th.png);
padding: 1px;
}

6
Draven
Re: {$xoops_imageurl} Problem
  • 2005/1/24 3:22

  • Draven

  • Module Developer

  • Posts: 337

  • Since: 2003/5/28


Can't tell from your last post if you figured out the problem or not, but one thing to note is that <{$xoops_imageurl}> only points to the themes root directory xoops/themes/mytheme/ and not a subfolder like /xoops/themes/mytheme/images. To do this you need to use:

background-image: url(<{$xoops_imageurl}>images/image.gif);


hope that helps

7
mixmaster
Re: {$xoops_imageurl} Problem
  • 2005/1/24 3:26

  • mixmaster

  • Just popping in

  • Posts: 28

  • Since: 2005/1/21


Quote:

AAINC wrote:
Here is the code from the ArchSilver theme, for the left blocks. xoops_imageurl does work in td background using html.

...

try this

<td width="##" height="##" background="<{$xoops_imageurl}>images/image.jpg"nbsp;</td>


Thanks, I'll try this approach. However, background used in HTML and background-image: used in style sheet are not the same thing. {$xoops_imageurl} works fine in HTML, but my concern was using it within style sheet.

8
tjnemez
Re: {$xoops_imageurl} Problem
  • 2005/1/24 3:28

  • tjnemez

  • Home away from home

  • Posts: 1594

  • Since: 2003/9/21


edit: forgot this is not for theme

9
Draven
Re: {$xoops_imageurl} Problem
  • 2005/1/24 3:29

  • Draven

  • Module Developer

  • Posts: 337

  • Since: 2003/5/28


Quote:

mixmaster wrote:

Thanks, I'll try this approach. However, background used in HTML and background-image: used in style sheet are not the same thing. {$xoops_imageurl} works fine in HTML, but my concern was using it within style sheet.


You cannot use smarty code in style sheets since the code is not run by smarty. The CSS includes are included by the browser upon rendering. Smarty never touchs the CSS file.

If you want to use a CSS background image you have to use it in the template itself as:

<td style='background-image: url(<{$xoops_imageurl}>images/image.gif);'> ... content... </td>

10
mixmaster
Re: {$xoops_imageurl} Problem
  • 2005/1/24 3:30

  • mixmaster

  • Just popping in

  • Posts: 28

  • Since: 2005/1/21


Quote:

Draven wrote:
Can't tell from your last post if you figured out the problem or not, but one thing to note is that <{$xoops_imageurl}> only points to the themes root directory xoops/themes/mytheme/ and not a subfolder like /xoops/themes/mytheme/images. To do this you need to use:

background-image: url(<{$xoops_imageurl}>images/image.gif);


hope that helps


I have no problem with where {$xoops_imageurl} points to. What I'm saying is that you can't even use <{$xoops_imageurl}> inside background-image: url( );, meaning this

background-image: url(<{$xoops_imageurl}>images/image.gif);
won't work. That's the whole problem!

Login

Who's Online

237 user(s) are online (136 user(s) are browsing Support Forums)


Members: 0


Guests: 237


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits