image Management

Image Management, a forum discussion on Jojo CMS. Join us for more discussions on Image Management on our General Discussion forum.

Back to Forum Index : Back to General Discussion   RSS
rhcarter

15 Mar 2010
Posts: 27

Hi,
I have uploaded images using the Edit Images menu and then try to put them in a page as described in the Working with Images doc - images/default/salmon-toasties.jpg

so I used

on the page I wanted it to appear on.

However there is just a big X and I am at a loss as to how to troubleshoot!

Secondly, when using the login plugin, it does not disappear when you have logged in - is there something I need to programme to do that as it looks as if you have failed when it was successful. It would be nice to have a bit of text saying welcome to the secure area for example

Thanks,
Roger
rhcarter

15 Mar 2010
Posts: 27

Putting the photos into the template/mytemplate/images dir sorted the problem. I thought I could use images loaded through the manage but that is obviously not the way it is done.

Just need to get the login window to close and sort the error message from the links plugin....

Parse error: syntax error, unexpected T_ELSE in /usr/home/website/cache/dwoo/templates_c/usr/home/website/jojo/plugins/jojo_links/templates/jojo_links.tpl.d16.php on line 149

Anyone got any ideas on this?

Regards,
Roger
tom

Developer

tom

15 Mar 2010
Posts: 379

the parse error is the template engine stumbling over something in the jojo_links plugin template - if you open the cache file listed in the error message to find what's happening at line 146, and then have a look at /usr/home/website/plugins/jojo_links/templates/jojo_link.tpl to find the same line in the actual template file and see if you can spot what the issue is.

You can post the line here for diagnosis but it may well be obvious when you look at it.

Dwoo is a bit fussier than the Smarty template engine we used to use and this template may not have been updated to suit.
rhcarter

15 Mar 2010
Posts: 27

Tom,
I changed to smarty and the links page works. Where do I find the cache files to look at - as you are not writing to the file system?

Also, any suggestions on solving the login window problem?

Thanks,
Roger
tom

Developer

tom

16 Mar 2010
Posts: 379

the cache files are written to the file system
for dwoo they are are in /usr/home/website/cache/dwoo/templates_c/usr/home/website/..
for smarty, i think it's just
/usr/home/website/cache/smarty/templates_c/
but the only time it's handy to look at them is when you get an error like this with a line number, and you want to find out what it's having a problem with.

not sure about the login issue - which plugin are you using to manage that?
You ought to be able to use Jojo's standard login, which just means putting a form somewhere in your template.
As for displaying messages and so on, i think there's a template variable for {$loggedIn} that you can use to check, and if they are logged in , the {$user} variable should also be available.

the following code is what we've used on a site with a Trade login.

{if $loggedIn}
<h3>Welcome {$userrecord.us_firstname}</h3>
<p class="note">Prices on the site have been adjusted to the rates set for this account</p>
<form id="loginform" action="logout" method="post">
<input id="logoutsubmit" type="submit" value="Logout" style="float:left" />
</form>
{else}
<div id="login" style="width:250px;">
<p class="note">Trade login requires a username and password. If you would like to apply for a trade account, please <a href="contact">contact us</a></p>
<form id="loginform" action="" method="post">
<input type="hidden" value="local" name="_jojo_authtype" />
<label for="loginemail">Username</label><input type="text" name="username" id="loginemail" size="28" /><br/>
<label for="loginpassword">Password</label><input type="password" name="password" id="loginpassword" size="28" />
<input type="submit" name="submit" value="Go" id="submit" size="28" />
<div id="login-bottom" style="clear:both;">
<span id="remember"><input type="checkbox" id="loginremember" name="remember" value="1" />Remember Me</span>
</div>
</form>
</div>
{/if}


that site uses the jojo_cart_checkout_userbased plugin and a customised product plugin to handle different pricing based on login
rhcarter

16 Mar 2010
Posts: 27

Tom,
I thought it easier to attach the cache file so you could see the whole of it - it is the final else it is complaining about - and there is content in the links table.

The login is Core-Login that I moved from "Not on Menu". I have attached a pdf showing the screen shots of before and after logging in.

I had thought that if the login box closes the blank screen could display the welcome message.

Regards,
Roger
rhcarter

16 Mar 2010
Posts: 27

Here is the php file - now zipped as requested
tom

Developer

tom

16 Mar 2010
Posts: 379

replace the jojo_links template with this

{$content}
<div class="links">
{if $linkcategorys}
{foreach from=$linkcategorys item=linkcat}
<div class="link-category">
<h3>{$linkcat.lc_name}</h3>
{if $linkcat.lc_desc}<strong>{$linkcat.lc_desc}</strong><br />{/if}

{foreach from=$links item=link}
{if $link.lk_categoryid == $linkcat.linkcategoryid}
<!-- [{$link.lk_name}] -->
<div class="link">
{if $link.lk_image}<img src="images/w100/links/{$link.lk_image}" alt="{$link.lk_name}" />{/if}
<h3><a href="{$link.lk_url}" target="_BLANK" title="{$link.lk_url|replace:"http://":""}"{if $link.lk_follow=='no'} rel="nofollow"{/if}>{$link.lk_name}</a></h3>
<p>{if $link.lk_desc}{$link.lk_desc}{/if}</p>
</div>
{/if}
{/foreach}
</div>
{/foreach}

{elseif $links}

{foreach from=$links item=link}
<!-- [{$link.lk_name}] -->
<div class="link">
{if $link.lk_image}<a href="{$link.lk_url}" target="_BLANK" title="{$link.lk_url|replace:"http://":""}"><img src="images/w100/links/{$link.lk_image}" alt="{$link.lk_name}" /></a>{/if}
<h3><a href="{$link.lk_url}" target="_BLANK" title="{$link.lk_url|replace:"http://":""}"{if $link.lk_follow=='no'} rel="nofollow"{/if}>{$link.lk_name}</a></h3>
<p>{if $link.lk_desc}{$link.lk_desc}<br />{/if}
<a href="{$link.lk_url}" target="_BLANK" title="{$link.lk_url|replace:"http://":""}">{$link.lk_url}</a></p>
</div>
{/foreach}

{else}
<p>There are currently no links in our database.</p>
{/if}
</div>

that should solve the dwoo issue (sections are smarty-specific and although dwoo tries to figure them out, this one took it a step too far by using a sectionelse)

.. I haven't tested this by the way, but it ought to be right..
rhcarter

16 Mar 2010
Posts: 27

Tom,
Yep, that one can be ticked off thanks!
tom

Developer

tom

16 Mar 2010
Posts: 379

as for the login page.. there are several approaches

generally the login page should be treated not as a real page but just one that gets shown to users on their way to somewhere else, called automatically whenever someone tries to access a page beyond their permission level.

So if you want a private area on the site, make a new user group, and set the permissions for that page to be viewable only by that group (and admin). Whenever someone tries to go to that page, they'll be asked to log in (by a redirect to the login page) and if successful, redirected again back to where they wanted to go. This allows a great deal of flexibility in allowing who can see what and making the login process relatively painless.
You can push the login form in front of any link by inserting /login/ in the url, after the domain, before the rest (which it will then use to do the redirect) - although it should be noted this is a technique for increasing ease of use, not a means of establishing security.

If you want to ease people into it more gently, i'd suggest calling the first page in that section something more indicative, like My Jump Start or whatever, and put some intro text on there to explain what's in this section, why you should register (and a link to the registration page), and a link to the protected page beneath it that explains that they'll be asked to log in when they click on it.

Perhaps even more graceful (and especially if you want login to affect content across the site generally rather than just controlling access to these pages) would be to include the snippet above in your standard template so that a nice looking login form is available on every page (or they get a 'welcome blah blah' when they are logged in).
This will encourage logging in (and make it more or less automatic if they let their browser store the password) and allow much greater tailoring of the content across the site.

If you really want to use the login page as a real page on the site you can customise its template as much as you like (just like any other) to display different info depending on whether they are logged in or not, by copying jojo_core/templates/login.tpl into your theme templates folder and fiddling with it. Just be aware that any other time it gets called (like when you want to access admin etc) that it will display your template then too.

clear as mud?
tom

Developer

tom

16 Mar 2010
Posts: 379

and finally, for the images.. yes you can put images directly in the theme/images folder, but because these aren't accessible through the admin, we normally reserve that folder for images used in the theme templates (which you don't want even admin users fiddling with), rather than content (which you certainly do).

For content images, the easiest approach is to use the Xinha content editor (you can change in options whether you want to use the WYSIWYG editor (Xinha) or the BBCode one. I think BBCode is what gets set as the default.
Xinha has an image manager built into it which allows you to upload/resize/rename images and drop them into your content.

Xinha does use a slightly different approach to Jojo, which i'd like to adjust at some point, in that it makes a resized copy of the image in the images folder and then links to that directly eg: downloads/images/resized__277x213_alastor.jpg

Jojo can access default sized images the same way: downloads/images/
BUT allows more flexibility in resizing by intercepting requests formatted as images/dimensions/path/filename and working out what you want to do with them.
So that images attached to articles for instance can be accessed through
images/dimensions/articles/filename
I have a feeling that although images in the theme/images folder are accessed by
images/dimensions/filename
that when they're in the downloads/images folder you have to double up and make it
images/dimensions/images/filename


Harvey

Core Developer

Harvey

17 Mar 2010
Posts: 327

tom said...

I have a feeling that although images in the theme/images folder are accessed by
images/dimensions/filename
that when they're in the downloads/images folder you have to double up and make it
images/dimensions/images/filename

No, it's not like that.

Both get accessed as images/dimensions/path/filename - however if there is a conflict, the theme images will be given priority.
Back to Forum Index : Back to General Discussion   RSS
You must be logged in to post a reply



You need to Register or Log In before posting on these forums.