Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: mem_randimg: Random Image from category
> Champak wrote:
> I have my code set up as below like trailgirl, it shows the picture but I get an error saying <code>tag_error <txp:mem_img/> -> Textpattern Warning: unknown_tag </code>.
Change your form to “<txp:mem_img />” — note the space before “/>”
Offline
#26 2006-02-02 23:03:56
- Champak
- Member
- Registered: 2006-01-31
- Posts: 56
Re: mem_randimg: Random Image from category
The actual tag in the form does look like that (if I understand you right)<code><txp:mem_img /></code>. The error is printing it without the space. What else could it be?
Offline
Re: mem_randimg: Random Image from category
Have you tried any other of the plugin’s form tags? Do they work? If you only plan on using the <txp:mem_img />
tag, then omit the form attribute from the mem_randimg tag.
Offline
#28 2006-03-01 08:46:24
- frederik
- Member
- From: Denmark
- Registered: 2004-12-08
- Posts: 17
Re: mem_randimg: Random Image from category
Hi,
I’ve problems using this plugin.
I’m using this in my page where I want the random image to show: <code><txp:mem_randimg form=“randomimage” category=“front” /></code> and my form looks like this:<code> <txp:mem_img /> </code>
For some reason only the alt text of the image shows! Any comments on how to solve this problem?
Here is the page in question.
Last edited by frederik (2006-03-01 13:25:50)
Offline
Re: mem_randimg: Random Image from category
Hi frederik, the alt text is showing because the image is not loading. Make sure that that path to your images folder is correct and that apache has the /images folder shared with proper permissions. I am unable to direct link the any of the images.
Offline
#30 2006-03-01 17:30:14
- frederik
- Member
- From: Denmark
- Registered: 2004-12-08
- Posts: 17
Re: mem_randimg: Random Image from category
Hi Manfre,
I tried changing the code of the plugin and replaced $path_from_root with $siteurl. As suggested here. That helped, but didn’t solve my problem.
The Txp tag <code><txp:image /></code> produces an absolute link to the image, where as the <code><txp:mem_randimg /></code> tag leaves out the http:// of the path – I think the problem lies here – I’m not a coder so I can’t seem to come up with a solution!
The page with the problem is the same as before.
/Frederik
Offline
#31 2006-03-01 17:42:26
- frederik
- Member
- From: Denmark
- Registered: 2004-12-08
- Posts: 17
Re: mem_randimg: Random Image from category
okay – i solved the problem by changing the $siteurl to ‘http://’.$siteurl.
Great plugin by the way!
/Frederik
Offline
#32 2006-03-09 22:01:44
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: mem_randimg: Random Image from category
Many thanks for this plugin.
Offline
Re: mem_randimg: Random Image from category
lee wrote:
Many thanks for this plugin.
You’re welcome.
Offline
Re: mem_randimg: Random Image from category
Hi everybody,
I’ve got a problem with this plugin: my images folder, as shown in the advanced preferences, is simply ‘images’, but to get the random pics visible i’ve got to change it in ‘txp/images’. I’m having trouble because if i act this way all the other images uploaded in my txp don’t show up, as their path result incorrect. What can i do?
Thanks
Vittorio
Happily served with Txp: Strampelli.net, Brain Essence, NicolaTranfaglia.com…
Offline
Re: mem_randimg: Random Image from category
Solved. Just used $siteurl but without de ‘http://’. as Frederik
Happily served with Txp: Strampelli.net, Brain Essence, NicolaTranfaglia.com…
Offline
#36 2006-05-19 21:23:17
- saccade
- Plugin Author
- From: Neubeuern, Germany
- Registered: 2004-11-05
- Posts: 521
Re: mem_randimg: Random Image from category
@Boogenstein
I don’t know if your question regarding CSS-background-images has been answered meanwhile, but since I needed the same thing, I found the following solution:
Add an additional style setting within the page template, and after the css-tag, which simply defines the background image for any element you need.
I did it like this (replace [selector] by your selector, e.g. div):
<code><style type=“text/css”>
<!—
[selector]
{
background: #eee url(<txp:mem_randimg form=“background” category=“background” />) top left no-repeat;
}
—>
</style>
</code>
with the form “background” simply containing this tag:
<code>
<txp:mem_img_url />
</code>
Last edited by saccade (2006-05-19 21:37:01)
Offline