I am just wondering if there is a way for elgg to detect if the user is on the home-page and show a file based on that. Kind of how the isloggedin() works.
So for instance
ifhomepage() {
link to the css
}
Any ideas...?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Kevin Jardine@kevin
Kevin Jardine - 0 likes
- Kevin Jardine@kevin
Kevin Jardine - 0 likes
- tcherokee@tcherokee
tcherokee - 0 likes
You must log in to post replies.That would be
if (getContext() == 'main') {
// do stuff
}
but I suspect that what you really want to do is to listen for the index plugin hook and provide content for the front page.
Sorry, that should be get_context, not getContext
Thanks Kevin, That worked perfectly.
I wanted to use it to detect if the user is on the homepage and then pull in a css file and if they were on any other page, pull in a different css file. Not sure if that was the most elegant way to do it... but it seems to be working perfectly