Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routing #138

Closed
wormen opened this issue Dec 22, 2014 · 13 comments
Closed

Routing #138

wormen opened this issue Dec 22, 2014 · 13 comments

Comments

@wormen
Copy link

wormen commented Dec 22, 2014

There is another point that I can not understand how to implement the essence of the problem is quite simple ......

I need to when you open the root site, opens a certain page template specifically for the home page

how to do for all other kind of figured out ....

@wormen
Copy link
Author

wormen commented Dec 22, 2014

wrote in a template so
{@if cond="{page}" }<div id="{page}_index"></div>{:else}<div id="main_mainpage"></div>{/if}

but does not roll so

@rdner
Copy link
Member

rdner commented Dec 23, 2014

You can see here my implementation of module that does page navigation.

@wormen
Copy link
Author

wormen commented Dec 23, 2014

as can be seen from the above conditions, it is well done, but it somehow does not work

@rdner
Copy link
Member

rdner commented Dec 23, 2014

Did you add required route to routes.js?
For example, like this.

@wormen
Copy link
Author

wormen commented Dec 23, 2014

yes of course

@wormen
Copy link
Author

wormen commented Dec 23, 2014

I like that there is written

module.exports = [
'/'
,'/:page[main, pages]'
,'/:page[main, pages]?query=:query[search]'
];

I tedious to the transition to site.ru/
opens the file main/placeholder/mainpage.dust

@rdner
Copy link
Member

rdner commented Dec 23, 2014

When you open site.ru/ you see main/placeholder/mainpage.dust template, right?
If so, that is correct behavior in your case.

What results do you want to reach?

@wormen
Copy link
Author

wormen commented Dec 23, 2014

No, not that, to date, using the condition above, I see the contents of any mainpage.dust on all pages, regardless of the url, or anywhere a blank page

@rdner
Copy link
Member

rdner commented Dec 23, 2014

Ok, I got it.

You are using {@if cond="{page}" /} dust-helper wrong. This helper works only with boolean expressions. In your case you should use the scope definition check expression like that:

{?page}<div id="{page}_index"></div>{:else}<div id="main_mainpage"></div>{/page}

@wormen
Copy link
Author

wormen commented Dec 23, 2014

checked and your option, nothing has changed

@wormen
Copy link
Author

wormen commented Dec 23, 2014

looked at the data router, there is valid data, the problem is obtained in the treatment of conditions

@rdner
Copy link
Member

rdner commented Dec 23, 2014

Try to remove this absolute redirect from the demo application.

If page parameter in routing rule is undefined then it redirects to the /about path.

@wormen
Copy link
Author

wormen commented Dec 23, 2014

I started the project from scratch to do, not because of the demo

@rdner rdner closed this as completed Dec 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants