1
o0pk0o
Relative image paths in blocks
  • 2004/2/21 23:42

  • o0pk0o

  • Just popping in

  • Posts: 20

  • Since: 2003/12/31


Hi! I've been looking for this answer for a couple days now, so I'm just going to state here:

How do you write an image path (i.e. img src=) into a block or html-wrapping module (i.e. tinycontent) as a relative path to the module?

I'm not looking for an absolute path answer. My goal is to be able to have the image display in a block according to to whatever theme is chosen.

So, in other words how do you code a relative path to your theme folder? Note: the <{$xoops_imageurl}> does not appear to work inside blocks.

Thank you!!

2
o0pk0o
Re: Relative image paths in blocks
  • 2004/4/30 16:42

  • o0pk0o

  • Just popping in

  • Posts: 20

  • Since: 2003/12/31


Hi, I'm just reviving this thread because I still haven't figured it out, and it never got any responses.

To clarify, I'm having problems getting pretty much any xoops/smarty code to work in blocks. I tried including the header/footer/mainfile.php etc in it, but that doesn't want to work either it seems.

So the question is again: How do you use your XOOPS variables in a custom/wrappedhtml block? I'm sure the answer is obvious, but I just ain't seeing it.

Thanks again!

3
myc1229
Re: Relative image paths in blocks
  • 2004/5/2 7:03

  • myc1229

  • Just popping in

  • Posts: 30

  • Since: 2004/4/10


Have you tried to use the {X_SITEURL}? It returns your site address

4
o0pk0o
Re: Relative image paths in blocks
  • 2004/5/12 0:14

  • o0pk0o

  • Just popping in

  • Posts: 20

  • Since: 2003/12/31


The problem I've been having is that no php code works in the blocks. It shows up as text in the browser when you're viewing it.

That is, echoing {X_SITEURL} would just return "{X_SITEURL}", not echo (for example)"www.pieterkonink.com".

5
Stewdio
Re: Relative image paths in blocks
  • 2004/5/12 2:12

  • Stewdio

  • Community Support Member

  • Posts: 1560

  • Since: 2003/5/7 1


Make sure you select from the drop down box Auto Format (Smilies disabled). This will print http://www.yourdomain.com (Text only)

You will need to place your {X_SITEURL} within appropriate tags to get the desired effect your are looking for. Using {X_SITEURL} buy itself will only print the text of your domain without a link.

6
Dave_L
Re: Relative image paths in blocks
  • 2004/5/12 9:03

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


{X_SITEURL} is a string used by the notification system in mail templates. It's not a Smarty tag, and is not translated except within mail templates.

7
Mithrandir
Re: Relative image paths in blocks

{X_SITEURL} should work in blocks - but I don't know if it is for autoformat or HTML only and not in php-type blocks.

In php blocks, you should be able to use the constant XOOPS_URL

8
Dave_L
Re: Relative image paths in blocks
  • 2004/5/12 10:42

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Oops, you're right.

Looking at XoopsBlock::getContent, it appears that it would work for any kind of block.

Login

Who's Online

319 user(s) are online (248 user(s) are browsing Support Forums)


Members: 0


Guests: 319


more...

Donat-O-Meter

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

Latest GitHub Commits