Joomla Field - Title with alias

9 jaren 1 maand geleden #650 door Geir
Joomla Field - Title with alias werd gestart door 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 add
 jimport('joomla.filter.output');
    if (empty($this->alias))
    {
       $this->alias = $this->title;
    }
    $this->alias = JFilterOutput::stringURLSafe($this->alias);
to public function check()

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" />
5. Locate com_yourComponent\administrator\views\yourTable\tmpl\edit.php and remove the title and alias fields, then add 
<?php echo JLayoutHelper::render('joomla.edit.title_alias', $this); ?>
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.
De volgende gebruiker (s) zei dank u: Fusió d'Arts Technology S.L., Andres Maeso, Juanjo vazquez real, Marinus Moerland, Pontus Karlsson, Виталий

Gelieve Inloggen of een account aanmaken om deel te nemen aan het gesprek.

9 jaren 1 maand geleden #656 door Andres Maeso
Beantwoord door Andres Maeso in topic 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.

Andrés Maeso
Customer relations manager at Joomla Component Creator.

Dit e-mailadres wordt beveiligd tegen spambots. JavaScript dient ingeschakeld te zijn om het te bekijken.

Gelieve Inloggen of een account aanmaken om deel te nemen aan het gesprek.

9 jaren 1 week geleden #699 door Gosling Cools
Beantwoord door Gosling Cools in topic Joomla Field - Title with alias
Didn't know about number 5. Great!

Gelieve Inloggen of een account aanmaken om deel te nemen aan het gesprek.

8 jaren 6 maanden geleden #1017 door Andres Maeso
Beantwoord door Andres Maeso in topic 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!

Andrés Maeso
Customer relations manager at Joomla Component Creator.

Dit e-mailadres wordt beveiligd tegen spambots. JavaScript dient ingeschakeld te zijn om het te bekijken.
De volgende gebruiker (s) zei dank u: Juanjo vazquez real

Gelieve Inloggen of een account aanmaken om deel te nemen aan het gesprek.

8 jaren 6 maanden geleden - 8 jaren 6 maanden geleden #1034 door Geir
Beantwoord door Geir in topic 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
Bijlagen:
Laatst bewerkt 8 jaren 6 maanden geleden door Geir.

Gelieve Inloggen of een account aanmaken om deel te nemen aan het gesprek.

8 jaren 5 maanden geleden #1039 door Andres Maeso
Beantwoord door Andres Maeso in topic 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.

Dit e-mailadres wordt beveiligd tegen spambots. JavaScript dient ingeschakeld te zijn om het te bekijken.

Gelieve Inloggen of een account aanmaken om deel te nemen aan het gesprek.

Tijd voor maken pagina: 0.256 seconden
Gemaakt door Kunena

We use cookies so that you can place orders and we can provide a better service. You can control the use of cookies at the individual browser level. If you reject cookies, you may still use our website, but your ability to use some features or areas of our website may be limited.