MODx Community Forums
The MODx Blog
Donations
Feedburner Feeds
Documentation
Bugs & Requests
The Wiki
download MODx
plugins, modules, snippets
online demo
Jul 05, 2009, 09:27 PM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search via SMF
or Google:
modx forums
all of modxcms.com
web
MODxCMS.com
Forums
Help
Login
Register
News
:Donate to MODx:
Donations
MODx Community Forums
»
Add-ons, Extensions & Elements
»
Navigation & Tagging/Taxonomy
»
[Plugin] AliasLinks
Pages: [
1
]
Go Down
« Previous topic
Next topic »
Print
Author
Topic: [Plugin] AliasLinks (Read 10154 times)
0 Members and 1 Guest are viewing this topic.
OpenGeek
MODx Co-Founder
Foundation
Posts: 5,814
damn accurate caricatures...
[Plugin] AliasLinks
«
on:
Feb 07, 2006, 04:05 PM »
As requested by someone on the #modx IRC channel, here is a short, sweet plugin for placing links in your content using the [~~] tag format by alias.
Example usage:
[~[+alias:
actual-doc-alias-here
+]~]
This will return the relative link to the document using the proper alias (if friendly_alias_urls is enabled), prefix, suffix, and alias path (if friendly_alias_paths is enabled). Please note, you must have friendly_urls enabled to use this, and you must make sure that every alias exists that you create a link to, otherwise, the parser in 0.9.1 will return an error like this:
Code:
Fatal error: Cannot use [] for reading in C:\dev\xampp\htdocs\modx\manager\includes\document.parser.class.inc.php(807) : regexp code on line 1
Here is the plugin code:
Code:
//AliasLinks plugin
$e = &$modx->event;
switch ($e->name) {
case "OnWebPageInit":
if ($modx->config['friendly_urls'] == 1) {
if (is_array($modx->documentListing)) {
foreach ($modx->documentListing as $linkAlias=> $linkDocId) {
$modx->setPlaceholder("alias:{$linkAlias}", "{$linkDocId}");
}
}
}
break;
default :
return; // stop here - this is very important.
}
You'll need to enable the plugin for the OnWebPageInit event. Let me know if you have any questions.
Logged
Jason Coward
MODx Co-Founder
xPDO Founder
CTO @
Collabpad
work
productively.
work
intelligently.
work
together
.
MODx
Development
|
SVN
|
Fisheye
xPDO
Development
|
SVN
|
Fisheye
Light is just a vibration of a note too. Everything is. You've got to keep that in mind.
Frank Zappa
Djamoer
Emeritus
Posts: 1,495
No one can limit a man other than the man himself.
Re: [Plugin] AliasLinks
«
Reply #1 on:
Feb 09, 2006, 08:45 AM »
Will this be added to the future release?
Logged
Wendy Novianto (
DJAMOER Solution and Design
)
Search
|
Download Latest Release
|
General Support
About MODx
|
Documentation
|
Bugs/Wishlist
|
FORUM RULES
sirvanderwaal
Jr. Member
Posts: 15
Re: [Plugin] AliasLinks
«
Reply #2 on:
Feb 20, 2006, 11:59 PM »
This is an AMAZING plugin! It should receive much more credit on the site! Good work!
-Andy
Logged
davidm
MODx evangelist
Marketing & Design Team
Posts: 7,026
Software is like sex, it's better when it's free !
Re: [Plugin] AliasLinks
«
Reply #3 on:
Feb 21, 2006, 03:11 AM »
Agreed Andy !
How did I miss that ?!?
It will be most certainly be of great use
Logged
.:
nodeo.net
: Pour un web libre, moderne et ouvert ! ::
david-molliere.net
:
Suivez en "live" mes expérimentations et billets sur les CMS et autres applications web
:.
***
Forums modxcms.fr
Participez ŕ l'élaboration du site MODx francophone !
***
! Nouveau !
En live, ne manquez pas les news de modxcms.fr sur Twitter
! Nouveau !
MODx est l'outil idéal pour les developpeurs et webdesigners qui cherchent un framework de gestion de contenu hautement flexible et performant, tout en étant simple d'accčs pour les utilisateurs finaux.
Config :
Apache 2.2.8 - MySQL 5.0.67 - PHP 5.2.8 | Debian 4.0 (Etch)
Réalisations sous MODx :
|
pargade-notaires.fr
|
soleil.info
|
gican.asso.fr
|
michelez-notaires.com
|
amadom.gerondicap.com
|
jocelyne-violet.net
Djamoer
Emeritus
Posts: 1,495
No one can limit a man other than the man himself.
Re: [Plugin] AliasLinks
«
Reply #4 on:
Feb 21, 2006, 08:41 AM »
Added to repository
Logged
Wendy Novianto (
DJAMOER Solution and Design
)
Search
|
Download Latest Release
|
General Support
About MODx
|
Documentation
|
Bugs/Wishlist
|
FORUM RULES
Djamoer
Emeritus
Posts: 1,495
No one can limit a man other than the man himself.
Re: [Plugin] AliasLinks
«
Reply #5 on:
Feb 28, 2006, 02:47 PM »
Quote from: OpenGeek on Feb 28, 2006, 02:30 PM
Also, if you want to build them using the alias instead of the id, you can take a look at my AliasLinks plugin at
http://modxcms.com/forums/index.php/topic,2763.0.html
-- you could use those in conjunction with #anchor links as well, like so:
Code:
[~[+alias:somepagealias+]~]#anchor
This might be useful for creating portable content dependent on aliases instead of document ids.
And FYI, [*alias*] only gets the current document's actual alias, not the full alias path as is applied via the [~~] tags, but this may be possible with the plugin, though I haven't tried it:
Code:
[~[+alias:[*alias*]+]~]#anchor
Just some other options I wanted to point out.
Logged
Wendy Novianto (
DJAMOER Solution and Design
)
Search
|
Download Latest Release
|
General Support
About MODx
|
Documentation
|
Bugs/Wishlist
|
FORUM RULES
bugsmi0
Sr. Member
Posts: 356
Re: [Plugin] AliasLinks
«
Reply #6 on:
Jul 02, 2006, 07:29 AM »
I don't get it how does this work ?
[~[+alias:actual-doc-alias-here+]~]
i tried it but no link [~[+alias:aliasname+]~]
are we suppose to put doc id with it ?
Logged
SMF Bookmark Mod - check it out
http://mods.simplemachines.org/index.php?mod=350
numberblack
Jr. Member
Posts: 8
Re: [Plugin] AliasLinks
«
Reply #7 on:
Nov 11, 2007, 08:09 AM »
I will renew this topic, because i also have the problem with creating alias links. I have the newest veriosn of modcsms
I installed, and enabled the plugin, but it doesnt work.
When i try to link, the tag [~44~] works fine, and outputs a firendly link to
http://mysite.com/category/alias-for-id-44.html
but
the command [~[+alias:alias-for-id-44+]~] doesnt work at all. I recieve a link which looks like that http:/mysite.com/[~~]
I tried many combinations of [ ] [[ ]] [++] [~~] but none was working
Has anyone solved this clue?
Logged
modx is amazing and brilliant. So is modx community!
znorelo
Member
Posts: 70
Re: [Plugin] AliasLinks
«
Reply #8 on:
Jan 09, 2008, 10:42 AM »
I have the same problem. Has enyone found a solution ?
Regards.
Logged
Aurélien Chappard
Concepteur Developpeur Multimédia
http://www.aurelienchappard.fr
prioritypie
Jr. Member
Posts: 12
Re: [Plugin] AliasLinks
«
Reply #9 on:
Feb 28, 2008, 07:08 AM »
AliasLinks was working fine on my site until I added the PHx plugin. Now it doesn't work at all. It looks like PHx somehow strips the alias: placeholder. Any ideas on how to get around this?
Logged
snaaps50
Jr. Member
Posts: 11
Re: [Plugin] AliasLinks
«
Reply #10 on:
Mar 15, 2008, 06:23 PM »
Here it dont work.
Only [~id~] works, but links to:
http://alias-name.html
(no domainname or subdirectory)
Logged
Pages: [
1
]
Go Up
Print
« Previous topic
Next topic »
Jump to:
Please select a destination:
-----------------------------
Announcements
-----------------------------
=> Important News
=> Security Notices
-----------------------------
Commercial Support
-----------------------------
=> [CS] About Commercial Support
-----------------------------
Development & Coding
-----------------------------
=> Commercial Inquiries & Bounties
=> Core Code
===> MODx Next
===> xPDO
=> Module, Plugin & Snippet Creation and Modification
=> In Development
=> Templates
-----------------------------
Add-ons, Extensions & Elements
-----------------------------
=> Module, Plugin & Snippet Usage
=> General Repository Items Support
=> Navigation & Tagging/Taxonomy
===> Wayfinder & DropMenu
=> Creating & Repurposing Content
===> Ditto
===> Jot
===> Front-end Document Management
=> Users, Authentication & Personalization
===> WebloginPE
===> WebLogin, WebSignup and WebChangePwd
=> Rich Text Editors & File Browser
===> TinyMCE
===> FCKeditor
===> MCPuck File Browser
=> Forms, Form Processing & Anti-Spam
===> eForm
=> Search
===> AjaxSearch
=> E-business
=> Polls, Calendars, Address Book and Community
=> Third-party integrations
=> Images, Videos & Podcasts
===> MaxiGallery
=> Manager, Parser & the Core
===> Backup & Versioning
===> Doc Finder
===> ManagerManager
===> PHx
=> Templates
-----------------------------
Support
-----------------------------
=> Release Support
===> 0.9.6.3
===> 0.9.6.2
===> 0.9.6.1
===> 0.9.6
===> 0.9.5 and earlier
=> General Support
===> MODx 101
===> E-Commerce, E-Marketing, Analytics & SEO
===> Hosting Experiences
===> IIS / Windows Hosting Issues
=> Documentation, Tips & Tricks
===> Documentation Suggestions & Corrections
-----------------------------
General Discussions
-----------------------------
=> General MODx Discussions
=> Webworker Lounge
=> Wishlist
=> You and Your Sites
=> modxcms.com Discussions and Suggestions
=> Off-topic
-----------------------------
International Support & Translations
-----------------------------
=> Internationalization
=> Bulgarian
===> Поддръжка
=====> Често задавани въпроси
=====> Инсталация
=====> Модули, Плъгини, Снипети и код
=====> Дизайн и Шаблони
===> Документация, Ръководства и Превод
=====> Документация
=====> Ръководства
=====> Превод
===> Общество
=====> Съобщения
=====> Представете се
=====> Представете сайта си
=====> Дискусии извън MODx
=> Chinese
=> Czech
===> Oznámení
=====> Důleitá oznámení/novinky
=====> Bezpečnost
===> Komunita
=====> Oznámení
=====> Představte se, prosím
=====> Ukázky práce
=====> Různé aneb cokoli co se jinam nehodí
===> Podpora
=====> FAQ (často kladené otázky)
=====> Instalace
=====> Moduly, pluginy, "snippets & code" (ablony zdrojových kódů)
=====> Design & ablony
===> Dokumentace, tutoriály (návody) a překlady
=====> Dokumentace
=====> Tutoriály (návody)
=====> Překlady (lokalizace)
=> Dutch
===> Ondersteuning
=====> Veel gestelde vragen
=====> Modules, Plugins, Snippets & Code
=====> Design & Templates
===> Documentatie, Tutorials en Vertalingen
=====> Documentatie
=====> Tutorials
=====> Vertalingen
===> Community
=====> Aankondigingen
=====> Stel jezelf voor
=====> Site Showcase
=====> De stamkroeg
=> Filipino
===> Suporta
=====> Kadalasang tanong
=====> Instalasyon
=====> Moduler, Maidadagdag, Karagdagang mga Code
=====> Desenyo at Templates
===> Dokumentasyon, Mga Turo, Mga Salin
=====> Dokumentasyon
=====> Mga Turo
=====> Mga Salin
===> Kumunidad
=====> Anunsyo
=====> Ipakilala ang sarili
=====> Ang Galing ng pinoy
=====> Tsismisan atbp
=> Finnish
===> Tuki
=====> UKK
=====> Asennus
=====> Moduulit, liitännäiset, koodinpätkät
=====> Ulkoasu/Sivustopohjat
===> Dokumentaatio, oppaat ja käännökset
=====> Dokumentaatio
=====> Käännökset
=====> Oppaat
===> Yhteisö
=====> Tiedotteet
=====> Esittele itsesi
=====> MODx sivustosi
=====> Kahvihuone
=> French
===> Support
=====> FAQ
=====> Installation
=====> Module, plugin, snippets
=====> Design/Templates
===> Documentation, Tutoriels et Traductions
=====> Documentation
=====> Traduction
=====> Tutoriels
===> Communauté
=====> Annonces
=====> Présentez vous
=====> Vos sites
=====> Le Bistrot Français
=> German
===> Support (de)
=====> FAQ (de)
=====> Installation (de)
=====> Module, Plugins, Snippets & Code (de)
=====> Design & Templates (de)
===> Dokumentation, Tutorials und Übersetzung
=====> Dokumentation
=====> Tutorials (de)
=====> Übersetzung
===> Community (de)
=====> Ankündigungen
=====> Stellt Euch vor
=====> Beispielseiten
=====> Off Topic / Verschiedenes
=> Hebrew
===> הכרזה
=====> חדשות חשובות
=====> אבטחה
===> תמיכה
=====> התקנה
=====> תיעוד, מדריכים ותרגומים
=====> עיצוב ותבניות
=====> שאלות נפוצות
===> תיעוד, מדריכים ותרגומים
=====> תיעוד
=====> מדריכים
=====> תרגומים
===> קהילה
=====> הודעות
=====> הצג את עצמך
=====> אתרים לדוגמא
=====> כללי
=> Irish
=> Italian
===> Supporto
=====> FAQ
=====> Installazione
=====> Moduli, Plugin, Snippet e altro codice
=====> Web Design e Template
===> Documentazione, Tutorial e Traduzione
=====> Documentazione
=====> Tutorial
=====> Traduzione
===> Comunitŕ
=====> Annunci
=====> Presentazioni
=====> Siti in vetrina
=====> Chiacchiere in libertŕ
=> Japanese
===> サポート
=====> 良くある質問
=====> インストール
=====> モジュール・プラグイン・スニペット・本体
=====> デザインやテンプレート
===> マニュアル・テュートリアル・翻訳
=====> マニュアル
=====> 事例集、テュートリアル
=====> 日本語化
===> コミュニティ
=====> お知らせ
=====> MODxサイト展示場
=====> 自己紹介
=====> 雑談
=====> 国産リソース
=> Persian - فارسي
===> پشتيباني
=====> راهنما
=====> نصب
=====> ماژول , پلاگین ها , کد ها و جزییات
=====> طراحی و قالب ها
===> مستند سازی , آموزش ها و ترجمه ها
=====> مستند سازی
=====> آموزش ها
=====> ترجمه ها
===> انجمن ها
=====> اخبار
=====> معرفی کردن خود
=====> نمایش دادن سایت ها
=====> بحث های عمومی و سایر موضوعات
=> Polish
===> Wsparcie
=====> FAQ
=====> Instalacja
=====> Moduły, pluginy, snipety i kod
=====> Wygląd i szablony
===> Dokumentacja, tutoriale i tłumaczenie
=====> Dokumentacja
=====> Tutoriale
=====> Tłumaczenie
===> Społeczność
=====> Ogłoszenia
=====> Przedstaw się
=====> Twój serwis WWW
=====> Hyde Park
=> Portuguese
===> Suporte
=====> FAQ - Dúvidas Frequentes
=====> Instalaçăo
=====> Módulos, Plugins, Snippets e Código
=====> Design e Templates
===> Documentaçăo, Guias e Traduçőes
=====> Documentaçăo
=====> Guias
=====> Traduçőes
===> Comunidade
=====> Anúncios
=====> Apresente-se!
=====> Bar da esquina (fora de tópico)
=====> Portfólio de Sites
=> Russian
===> Поддержка
=====> ЧАВО (FAQ)
=====> Установка
=====> Модули, плагины, сниппеты и код
=====> Дизайны и шаблоны
===> Документация, Уроки, Перевод
=====> Документация
=====> Уроки
=====> Перевод
===> Сообщество
=====> Объявления
=====> Представьтесь публике
=====> Галерея сайтов
=====> Диван
=> Scandanavian
===> Support
=====> Frĺgor och svar
=====> Installation
=====> Moduler, plugins, snippets och kod
=====> Design & sidmallar
===> Dokumentation, guider och översättningar
=====> Dokumentation
=====> Guider
=====> Översättningar
===> Webbgemenskap
=====> Meddelanden
=====> Presentera dig själv
=====> Visa upp dina webbsidor
=====> Ordet fritt
=> Slovak
=> Spanish
===> Soporte
=====> FAQ
=====> Instalación
=====> Modulos, Plugins, Snippets & Código
=====> Diseńo y plantillas
===> Documentación, Tutoriales y Traducciones
=====> Documentatción
=====> Tutoriales
=====> Traducciones
===> Comunidad
=====> Anuncios
=====> Presentaciones personales
=====> Muestra de sitios
=====> El Café
=> Swedish
=> TÜRKÇE (Turkish)
===> Destek
=====> SSS
=====> Kurulum
=====> Modüller, Pluginler, Snippetlar & Kodlar
=====> Dizayn & Temalar
===> Belgeleme, Eğitmenler ve Çeviri
=====> Belgeleme
=====> Eğitmenler
=====> Çeviri
===> Topluluk
=====> Duyurular
=====> Kendinizi Tanıtın
=====> Site Vitrini
=====> Konu Dışı