Joomla Field - Title with alias
Geir
New Member
Posts: 15
pred 9 rokmi 9 mesiacmi #650
od Geir
Joomla Field - Title with alias bolo vytvorené Geir
Here is a quick recipe to create URL safe aliases. It does not include routing, if you need it, check out the
Joomla! docs
.
1. Create title and alias in your component, as regular Joomla textfield.
2. Build your component and unzip component.
3. Locate com_yourComponent\administrator\tables\yourTable.php and addto public function check()
4. Locate com_yourComponent\administrator\models\forms\yourTable.xml and replace title and alias fields with5. Locate com_yourComponent\administrator\views\yourTable\tmpl\edit.php and remove the title and alias fields, then add as the first line after the opening form tag
That's it! If I haven't forgotten anything at least (if I have, let me know so I can correct it).
Your title and alias fields are now using joomlas own strings, so you could clean up your language files as well.
1. Create title and alias in your component, as regular Joomla textfield.
2. Build your component and unzip component.
3. Locate com_yourComponent\administrator\tables\yourTable.php and add
jimport('joomla.filter.output');
if (empty($this->alias))
{
$this->alias = $this->title;
}
$this->alias = JFilterOutput::stringURLSafe($this->alias);
4. Locate com_yourComponent\administrator\models\forms\yourTable.xml and replace title and alias fields with
<field name="title" type="text" label="JGLOBAL_TITLE"
description="JFIELD_TITLE_DESC"
class="input-xxlarge input-large-text"
size="40"
required="true" />
<field name="alias" type="text" label="JFIELD_ALIAS_LABEL"
description="JFIELD_ALIAS_DESC"
hint="JFIELD_ALIAS_PLACEHOLDER"
size="40" />
<?php echo JLayoutHelper::render('joomla.edit.title_alias', $this); ?>
That's it! If I haven't forgotten anything at least (if I have, let me know so I can correct it).
Your title and alias fields are now using joomlas own strings, so you could clean up your language files as well.
Nasledujúci užívateľ(ia) povedali ďakujem: Fusió d'Arts Technology S.L., Andres Maeso, Juanjo vazquez real, Marinus Moerland, Pontus Karlsson, Виталий
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
Andres Maeso
Platinum Member
Posts: 338
pred 9 rokmi 9 mesiacmi #656
od Andres Maeso
Andrés Maeso
Customer relations manager at Joomla Component Creator.
Táto e-mailová adresa je chránená pred spamovacími robotmi. Na jej zobrazenie potrebujete mať nainštalovaný JavaScript.
Odpoveď od Andres Maeso na tému Joomla Field - Title with alias
Hey Geir
Much appreciated. Hope this helps everybody, seems to be a very popular feature that we have to implement yet.
Much appreciated. Hope this helps everybody, seems to be a very popular feature that we have to implement yet.
Andrés Maeso
Customer relations manager at Joomla Component Creator.
Táto e-mailová adresa je chránená pred spamovacími robotmi. Na jej zobrazenie potrebujete mať nainštalovaný JavaScript.
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
Gosling Cools
Junior Member
Posts: 20
pred 9 rokmi 8 mesiacmi #699
od Gosling Cools
Odpoveď od Gosling Cools na tému Joomla Field - Title with alias
Didn't know about number 5. Great!
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
Andres Maeso
Platinum Member
Posts: 338
pred 9 rokmi 2 mesiacmi #1017
od Andres Maeso
Andrés Maeso
Customer relations manager at Joomla Component Creator.
Táto e-mailová adresa je chránená pred spamovacími robotmi. Na jej zobrazenie potrebujete mať nainštalovaný JavaScript.
Odpoveď od Andres Maeso na tému Joomla Field - Title with alias
Hi!
Thanks again for posting that temporary solution. We have already implemented an Alias field with router support so I guess it won't be necessary
www.component-creator.com/en/blog/entry/...-with-router-support
Enjoy it!
Thanks again for posting that temporary solution. We have already implemented an Alias field with router support so I guess it won't be necessary
www.component-creator.com/en/blog/entry/...-with-router-support
Enjoy it!
Andrés Maeso
Customer relations manager at Joomla Component Creator.
Táto e-mailová adresa je chránená pred spamovacími robotmi. Na jej zobrazenie potrebujete mať nainštalovaný JavaScript.
Nasledujúci užívateľ(ia) povedali ďakujem: Juanjo vazquez real
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
Geir
New Member
Posts: 15
pred 9 rokmi 1 mesiacom - pred 9 rokmi 1 mesiacom #1034
od Geir
Odpoveď od Geir na tému Joomla Field - Title with alias
It's great to see you have implemented the routing feature for alias field.
My temporary solution however, is still valid, as it adds the missing parts of your implementation.
- Title/alias layout.
- URLsafe alias autogenerated from title
My temporary solution however, is still valid, as it adds the missing parts of your implementation.
- Title/alias layout.
- URLsafe alias autogenerated from title
Posledný krát upravené:pred 9 rokmi 1 mesiacom Geir
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
Andres Maeso
Platinum Member
Posts: 338
pred 9 rokmi 1 mesiacom #1039
od Andres Maeso
Andrés Maeso
Customer relations manager at Joomla Component Creator.
Táto e-mailová adresa je chránená pred spamovacími robotmi. Na jej zobrazenie potrebujete mať nainštalovaný JavaScript.
Odpoveď od Andres Maeso na tému Joomla Field - Title with alias
Fair point! Will tell our developers about the options to add those improvements
Andrés Maeso
Customer relations manager at Joomla Component Creator.
Táto e-mailová adresa je chránená pred spamovacími robotmi. Na jej zobrazenie potrebujete mať nainštalovaný JavaScript.
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
Čas vytvorenia stránky: 0.067 sekúnd