Different _REGISTER_TITLE

12 years 4 months ago #184547 by turkish74
Different _REGISTER_TITLE was created by turkish74
Hi all

On my Homepage i use the registration form from CB. I have linked the Registration Form to Menu A and again to Menu B.

No im looking for a solution to have different Titles. But this is just one Registration Form and it takes the title from the language plugins with _REGISTER_TITLE (Multilingual Site). Any ideas how i can achieve this?

Cheers

Please Log in to join the conversation.

12 years 4 months ago #184875 by turkish74
Replied by turkish74 on topic Re: Different _REGISTER_TITLE
Hi all

If i need subscription to answer this question, let me know.

Cheers

Please Log in to join the conversation.

12 years 4 months ago - 12 years 4 months ago #185635 by sfraise
Replied by sfraise on topic Re: Different _REGISTER_TITLE
I'm not sure what you mean by "different" titles, you mean you want different titles according to which menu the registration link is clicked? If that's the case you're going to have to do some php coding, probably the easiest way to do it is to add something like &regtitle=title1 to one menu link and &regtitle=title2 to the other then add some php code to do a $title = $_GET, and the new language strings to the language file like _register_title1 = whatever and _register_title2 = something else, then do an if($title == title1) to set the new language variable for that title.

Please Log in to join the conversation.

12 years 4 months ago - 12 years 4 months ago #185661 by turkish74
Replied by turkish74 on topic Re: Different _REGISTER_TITLE
Yes, this is what i want. Isnt it there a easier way to give them a different title? Maybe with a second form? isnt that possible?

And what is, if update the CB? Do i have then edit again the PHP Code?

Cheers

Please Log in to join the conversation.

12 years 4 months ago - 12 years 4 months ago #185755 by sfraise
Replied by sfraise on topic Re: Different _REGISTER_TITLE
There's really not an easier way to do this than what I proposed, creating a second form is much more involved and will take a more in depth understanding of php and cb as you'll have the hash security stuff to deal with and so on. I can try and give you a general step by step on how to do what I proposed though.

Step 1.
At the end of your first link to the registration form add &regtitle=title1
(it will look like index.php?option=com_comprofiler&task=registers&regtitle=title1)

Step 2.
At the end of your second link to the registration form add &regtitle=title2

Step 3.
Find the following lines in /components/com_comprofiler/comprofiler.html.php (it's line 1607 in my file but may be different on yours):
// renders using template viewer
echo HTML_comprofiler::_cbTemplateRender( $cbTemplate, $user, 'RegisterForm', 'drawProfile', array( &$user, $tabcontent, $regFormTag, $introMessage, _LOGIN_REGISTER_TITLE, _REGISTER_TITLE, _UE_REGISTER, $moduleContent, $topIcons, $bottomIcons, $conclusionMessage ), $output );
And replace it with this:
$regtitle = $_GET['regtitle'];
		if($regtitle == 'regtitle1') {
		 echo HTML_comprofiler::_cbTemplateRender( $cbTemplate, $user, 'RegisterForm', 'drawProfile', array( &$user, $tabcontent, $regFormTag, $introMessage, _LOGIN_REGISTER_TITLE, _REGISTER_TITLE1, _UE_REGISTER, $moduleContent, $topIcons, $bottomIcons, $conclusionMessage ), $output );
		}
		elseif($regtitle == 'regtitle2') {
		 echo HTML_comprofiler::_cbTemplateRender( $cbTemplate, $user, 'RegisterForm', 'drawProfile', array( &$user, $tabcontent, $regFormTag, $introMessage, _LOGIN_REGISTER_TITLE, _REGISTER_TITLE2, _UE_REGISTER, $moduleContent, $topIcons, $bottomIcons, $conclusionMessage ), $output );
		}
		else {
		 echo HTML_comprofiler::_cbTemplateRender( $cbTemplate, $user, 'RegisterForm', 'drawProfile', array( &$user, $tabcontent, $regFormTag, $introMessage, _LOGIN_REGISTER_TITLE, _REGISTER_TITLE, _UE_REGISTER, $moduleContent, $topIcons, $bottomIcons, $conclusionMessage ), $output );
		}

Step 4.
Open file /components/com_comprofiler/plugin/language/default_language/default_language.php and find the following line (line 798 in my file):
if (!defined('_REGISTER_TITLE'))	DEFINE('_REGISTER_TITLE','Registration');
And add 2 more line right below it like this:
if (!defined('_REGISTER_TITLE'))	DEFINE('_REGISTER_TITLE1','New registration title for link 1');
if (!defined('_REGISTER_TITLE'))	DEFINE('_REGISTER_TITLE2','New registration title for link 2');

This should do what you need, I haven't tested it so I can't guarantee it works but it should.

Basically what you're doing here is adding the end piece to your link to determine what link was used, the code looks at the piece at the end of the url and uses the if/else statement to determine which language variable to load according to what link was used, then finally the language variable gives you the actual title text you want.

Too easy right?
The following user(s) said Thank You: turkish74

Please Log in to join the conversation.

12 years 4 months ago - 12 years 4 months ago #185861 by turkish74
Replied by turkish74 on topic Re: Different _REGISTER_TITLE
Hi sfraise

Thank you for your great job.

I followed your instruction carefully. Unfortunatly it doesnt work.
Maybe i made some mistakes a the step 1 and step 2.

I have multilingual site and the link is this:

/index.php?option=com_comprofiler&task=registers&regtitle=title1&Itemid=193&lang=en
/index.php?option=com_comprofiler&task=registers&regtitle=title2&Itemid=193&lang=en

With this constellation, it doesnt change the title.

I though ok, in the link this is title1 and title2. I replaced both with regtitle1 and regtitle2, as i saw in the comprofiler.html.php.

Now the titles are switching from _REGISTER_TITLE2 to _REGISTER_TITLE1, but doesnt take, what was in the default_language.php has been placed.

Now i deleted the line:

if (!defined('_REGISTER_TITLE')) DEFINE('_REGISTER_TITLE','Online Registration');

then it begun to switch from New registration title for link 1 to New registration title for link 2.

Is that fine, or shoudnt i delete the line in the language php file?

There was also a problem with joomfish, it had translate the &regtitle with a copyright symbol. But i coud changed it manually.

Another Problem now is the link in Login form. In the modul,it is not possible to hide the Registration Link. What can i do?



the site is www.haqq-adalet.com

Cheers
Attachments:

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.265 seconds

Facebook Twitter LinkedIn