Main menu

Forum


× Help Forum English

[VIEWED] url register page

  • Lianne
  • Topic Author
  • New Member
  • New Member
More
10 years 9 months ago - 10 years 9 months ago #6888 by Lianne
[VIEWED] url register page was created by Lianne
Hi,

I like to change the url of the page where users can register for an event, now (website-url/menu-item/)ID-name-of-the-event/event_registration. I should like more: ..../name-of-the-event/registration (and then registration as string, ready for a language-override) How can I reach this?

Thanks!

Lianne
Last edit: 10 years 9 months ago by Lyr!C. Reason: [VIEWED]

Please Log in or Create an account to join the conversation.

  • Lyr!C
  • Lyr!C's Avatar
  • Administrator
  • Administrator
  • Lead Developer
More
10 years 9 months ago #6934 by Lyr!C
Replied by Lyr!C on topic url register page
Hello,

This could be change in route.php, but to be honnest, it is something since a long time in my todo list, to set it as a translation string, but i've completly forgotten it!

Thank you to remind me this issue!
;-)

Cyril

Latest version : iCagenda 3.9.8
We recommend every user to keep iCagenda updated.
Don't forget to have your Joomla!™ up-to-date!

Do you like iCagenda?
I would appreciate if you could take 5 minutes to post a review on JED (Joomla Extensions Directory) .

File Attachment:

Please Log in or Create an account to join the conversation.

  • hunjoeyjay
  • New Member
  • New Member
More
10 years 9 months ago #6952 by hunjoeyjay
Replied by hunjoeyjay on topic url register page
Ok, so i opened route.php

I have looked for the line event_details coz search engines keep downgrading my site as it contains underscores in these URLs...

I have changed it to event-details, so it now doesn't work.

There's something else too that i must change I guess. Could any of you help?

Thanks :)
Joseph

Please Log in or Create an account to join the conversation.

  • Lyr!C
  • Lyr!C's Avatar
  • Administrator
  • Administrator
  • Lead Developer
More
10 years 9 months ago #6961 by Lyr!C
Replied by Lyr!C on topic url register page
Hello!

Yes, strange behaviour due to Joomla routing.

So, replace the 2 "event_details" by "event:details" and it will return "event-details"...

;-)

Latest version : iCagenda 3.9.8
We recommend every user to keep iCagenda updated.
Don't forget to have your Joomla!™ up-to-date!

Do you like iCagenda?
I would appreciate if you could take 5 minutes to post a review on JED (Joomla Extensions Directory) .

File Attachment:

Please Log in or Create an account to join the conversation.

  • Lyr!C
  • Lyr!C's Avatar
  • Administrator
  • Administrator
  • Lead Developer
More
10 years 9 months ago - 10 years 9 months ago #6963 by Lyr!C
Replied by Lyr!C on topic url register page
Due to difficulties to use a translation string, i will maybe remove "event_details" from url (as in fact, not really needed!)

If you want, you can test this code for router.php, which will remove "event_details", and will display only alias and id of event.
<?php
/**
 *------------------------------------------------------------------------------
 *  iCagenda v3 by Jooml!C - Events Management Extension for Joomla! 2.5 / 3.x
 *------------------------------------------------------------------------------
 * @package     com_icagenda
 * @copyright   Copyright (c)2012-2014 Cyril Rezé, Jooml!C - All rights reserved
 *
 * @license     GNU General Public License version 3 or later; see LICENSE.txt
 * @author      Cyril Rezé (Lyr!C)
 * @link        http://www.joomlic.com
 *
 * @version     3.3.3 2014-03-31
 * @since       1.0
 *------------------------------------------------------------------------------
*/

// No direct access to this file
defined('_JEXEC') or die();


function iCagendaBuildRoute( &$query )
{
		$segments = array();

		// link event
		if(isset($query['layout']) && $query['layout']=='event')
		{
				// Make sure we have the id and the alias
				if (strpos($query['id'], ':') === false)
				{
						$db = JFactory::getDbo();
						$aquery = $db->setQuery($db->getQuery(true)
							->select('alias')
							->from('#__icagenda_events')
							->where('id='.(int)$query['id'])
						);
						$alias = $db->loadResult();

						$query['id'] = $query['id'].':'.$alias;
						//$query['id'] = $alias;
				}

				$segments[] = $query['id'];
				unset($query['id']);

				unset($query['view']);
				unset($query['layout']);
		}

		// link submit
		if(isset($query['layout']) && $query['layout']=='send')
		{
				$segments[] = $query['id'];
				unset($query['id']);

				$segments[]='sending';
				unset($query['view']);
				unset($query['layout']);
		}

		// link registration
		if(isset($query['layout']) && $query['layout']=='registration')
		{
				// Make sure we have the id and the alias
				if (strpos($query['id'], ':') === false)
				{
						$db = JFactory::getDbo();
						$aquery = $db->setQuery($db->getQuery(true)
							->select('alias')
							->from('#__icagenda_events')
							->where('id='.(int)$query['id'])
						);
						$alias = $db->loadResult();

						$query['id'] = $query['id'].':'.$alias;
						//$query['id'] = $alias;
				}

				$segments[] = $query['id'];
				unset($query['id']);

				$segments[]='event_registration';
				unset($query['view']);
				unset($query['layout']);
		}

		// link search
		if(isset($query['view'])&&$query['view']=='search')
		{
				$segments[]='search';
		}

		// link submit
		if(isset($query['view'])&&$query['view']=='submit')
		{
				$segments[]='submission';
				unset($query['view']);
				unset($query['layout']);
		}

		return $segments;
}

function iCagendaParseRoute( $segments )
{
		$app = JFactory::getApplication();
		$menu = $app->getMenu();
		$item = $menu->getActive();
		$vars = array();

		// Count route segments
		$count = count($segments);

		if (in_array('sending', $segments))
		{
				$vars['option']	= 'com_icagenda';
				$vars['view']	= 'submit';
				$vars['layout']	= 'send';
				$vars['id'] 	= $segments[0];
		}
		elseif (in_array('event_registration', $segments))
		{
				$vars['option']	= 'com_icagenda';
				$vars['view']	= 'list';
				$vars['layout']	= 'registration';
				$vars['id'] 	= $segments[0];
		}
		elseif (in_array('search', $segments))
		{
				$vars['option']	= 'com_icagenda';
				$vars['view']	= 'list';
				$vars['layout']	= 'search';
		}
		elseif (in_array('submission', $segments))
		{
				$vars['option']	= 'com_icagenda';
				$vars['view']	= 'submit';
		}
		else
		{
				$vars['option']	= 'com_icagenda';
				$vars['view']	= 'list';
				$vars['layout']	= 'event';
				$vars['id'] 	= $segments[0];
		}
		return $vars;
}

If you test it, thank you for your feedback ;-)

Cyril

Latest version : iCagenda 3.9.8
We recommend every user to keep iCagenda updated.
Don't forget to have your Joomla!™ up-to-date!

Do you like iCagenda?
I would appreciate if you could take 5 minutes to post a review on JED (Joomla Extensions Directory) .

File Attachment:

Last edit: 10 years 9 months ago by Lyr!C.

Please Log in or Create an account to join the conversation.

  • Lyr!C
  • Lyr!C's Avatar
  • Administrator
  • Administrator
  • Lead Developer
More
10 years 9 months ago #6994 by Lyr!C
Replied by Lyr!C on topic url register page

Hi You have closed the forum so I could not leave a thank you or a comment there (+its in French so I got no clue where to leave the comment)
Thank you very much for the codes!

It works perfectly. It grabs the id and alias of the article and adds event-details at the end

Perfect.
Thank you very much. We have improved 4 scores on google.co.uk already:)


Kind regards,
Joseph J


Hello!

I have not closed the forum, but you was not able to answer only because you was not logged-in ;-)

This will be now added officially. It doesn't break old url (with event_details still working!) and add a better looking SEO!
Nice to hear that yu have already increase you google score! ;-)

Thank you for your testing!
Best Regards,
Cyril

Latest version : iCagenda 3.9.8
We recommend every user to keep iCagenda updated.
Don't forget to have your Joomla!™ up-to-date!

Do you like iCagenda?
I would appreciate if you could take 5 minutes to post a review on JED (Joomla Extensions Directory) .

File Attachment:

Please Log in or Create an account to join the conversation.

Moderators: Lyr!C
Time to create page: 0.149 seconds

 

Follow Us

Create your Joomla templates with Template Creator CK

acymailing logo new