We launched new forums in March 2019—
join us there
.
In a hurry for help with your website?
Get Help Now!
Back to MODX.com
Forums
Docs
Revo Issues
Blog
My Forums
Add-ons
Using MODX Add-ons
Search
Snippet Call Chunk
93 Posts
elven_ranger
Reply #1,
17 years, 3 months ago
Is this possible that a Snippet can call a Chunk?
How to do it?
Thanks
Ruang Nol @
http://ruangnol.wordpress.com/
1,390 Posts
kongondo
Reply #2,
17 years, 3 months ago
A snippet can do anything
$modx->getChunk('chunk_name');
cheers/k
Wayfinder Lessons:
The (almost) Complete Guide to Creating Menus in MODx Using Wayfinder
93 Posts
elven_ranger
Reply #3,
17 years, 3 months ago
Great Thanks
Ruang Nol @
http://ruangnol.wordpress.com/
93 Posts
elven_ranger
Reply #4,
17 years, 3 months ago
It won’t work. Why?
I put some href in the chunk
but it didn’t appear when I call it in the snippet.
Ruang Nol @
http://ruangnol.wordpress.com/
171 Posts
etal
Reply #5,
17 years, 3 months ago
What is the snippet returning?
Are you adding the chunk to the output of the snippet?
Like this for example:
$output = $modx->getChunk('chunk_name'); return $output;
93 Posts
elven_ranger
Reply #6,
17 years, 3 months ago
OH so I must put that on the return? I didn’t return anything right now. I’ll try, thanks
Ruang Nol @
http://ruangnol.wordpress.com/
1,390 Posts
kongondo
Reply #7,
17 years, 3 months ago
Here’s some nice MODx Snippet FAQ/Tuts.
http://bobsguides.com/modx-snippet-faq.html
http://wiki.modxcms.com/index.php/Creating_Snippets
cheers/k
Wayfinder Lessons:
The (almost) Complete Guide to Creating Menus in MODx Using Wayfinder
93 Posts
elven_ranger
Reply #8,
17 years, 3 months ago
It works, thanks etal and kongondo
Ruang Nol @
http://ruangnol.wordpress.com/