-
AuthorPosts
-
September 19, 2016 at 10:13 am #969105
Trying to set-up a new site where some of the content is restricted to member only content.
Each article has a Intro section with a read more break. If the article is restricted access, the "Read More" button on a Category Blog page changes to "Register to Read More" which, when clicked, takes the user to a login page, as it should.
Using the JA Sugite (and also JA Biz) template, once logged in, the user is directed to their profile page.
Using the Beez or Prostar templates, the user is directed back to the page.
Looking at the pages in detail, using JA Sugite template, the "Register to Read More" link for one of the articles is
/membersonly/index.php/login?return=L21lbWJlcnNvbmx5L2luZGV4LnBocC9hZHZpY2UvNjMtY2FtcGRlbi1icmktbmV3cy13LWMtNS1zZXA=
but when using the Beez template the link is
/membersonly/index.php/login?return=aW5kZXgucGhwP29wdGlvbj1jb21fY29udGVudCZ2aWV3PWFydGljbGUmaWQ9NjM6Y2FtcGRlbi1icmktbmV3cy13LWMtNS1zZXAmY2F0aWQ9OSZJdGVtaWQ9MTI2
Once the login page is reached, on JA Sugite I see a return value
aW5kZXgucGhwP29wdGlvbj1jb21fdXNlcnMmdmlldz1wcm9maWxl
but with Beez the return value is
aW5kZXgucGhwP29wdGlvbj1jb21fY29udGVudCZ2aWV3PWFydGljbGUmaWQ9NjM6Y2FtcGRlbi1icmktbmV3cy13LWMtNS1zZXAmY2F0aWQ9OSZJdGVtaWQ9MTI2
If I use Beez as the default template but use a menu link for login to specify JA Sugite for the login page, the correct value is sent. It looks as thought Sugite is preparing an incorrect return value and/or the login page is not interpreting the return value correctly.
I have added the site info to the Staff/Mod section. It is the advice section which has registered content.
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
September 21, 2016 at 4:13 am #969671Hi,
I fixed the problem directly on your site with the solution below
Open templates/ja_sugite/html/com_content/category/blog_item.php file
find
if ($params->get('access-view')) : $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); else : $menu = JFactory::getApplication()->getMenu(); $active = $menu->getActive(); $itemId = $active->id; $link1 = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId); $returnURL = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); $link = new JURI($link1); $link->setVar('return', base64_encode($returnURL)); endif;
to
if ($params->get('access-view')) : $link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)); else : $menu = JFactory::getApplication()->getMenu(); $active = $menu->getActive(); $itemId = $active->id; $link = new JUri(JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false)); $link->setVar('return', base64_encode(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language))); endif;
Now, it’s working as well on your site.
Regards
1 user says Thank You to Ninja Lead for this useful post
September 21, 2016 at 9:29 am #969788Thanks for the assistance, was driving me mad!
That solves the immediate problem on the Sugite template. The same problem still exists on JA Biz (which I do hope to use on other sites).
Will future updates of Sugite/Biz contain the fix or will I need to always apply it every time I update the template?
Ninja Lead ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
September 22, 2016 at 4:15 am #970070 -
AuthorPosts
This topic contains 4 replies, has 3 voices, and was last updated by Ninja Lead 8 years, 3 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum