User image problems

Discuss PivotX 2.0.x here. Non-PivotX related discussions go in The Drain.

User image problems

Postby attrib » Thu Nov 17, 2011 1:46 am

hello there,

recently i've start working with PivotX and I must say I like it a lot!
however there's one thing I can't solve when trying to make my blog.

I want to place my user image (the one you upload via Administration - Users at the Dashboard) in the _sub_sidebar.html and place it there just once.
I noticed it's not possible to put a [[ user field=image ]] tag outside the [[ subweblog ]] so I tried and solved the problem with:
Code: Select all
[[ subweblog name="standard" amount="1" ]]

without the amount="1" setting it will show the image just as many times as the entries you have on your page.
so far this method only works with my frontpage.

when (for example) sort entries by month it ignores the amount="1" setting and it will display the image as many times as the found entries.

is there a way to fix this? is it possible to use the [[user field=image]] field outside the subweglog so it's not connected to the placed entries?
Posts: 5
Joined: Thu Nov 17, 2011 1:01 am

Re: User image problems

Postby hansfn » Thu Nov 17, 2011 8:49 am

As the documentation says the user tag is for picking up information about the author of the current entry or page. Work-around (without using a subweblog) - in _sub_sidebar.html insert:

Code: Select all
            [[assign var=user value=yourusername]]
            <img src="[[upload_dir]][[user field=image]]" />

PS! You could have used the subweblog as you did - just change name from "standard" to for example "authorimage". The name "standard" is kind of reserved since it is used dynamically for paging/archive.
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: User image problems

Postby attrib » Sat Nov 19, 2011 5:27 pm

thanks Hans, that worked!
didn't know that 'assign var' works like that.

and changing the name of the subweblog.. it makes very sense. why didn't I came up with that right away! :D
once again, thanks!
Posts: 5
Joined: Thu Nov 17, 2011 1:01 am

Return to 2.x Discussion

Who is online

Users browsing this forum: No registered users and 1 guest