Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mitra 81 posts 196 karma points
    Feb 23, 2015 @ 11:17
    Mitra
    0

    Macro and different controls

    I have got a page, which has got different categories and serach and filters. It's a news page which seperates to News, blog, events and all (using uDateFoldersy ).... then different category of the news, which i have used the nodepicker for it. and then i have the filter of year(dropdown list) and the months....

    what i am not sure about, shall i put all of them in one macro? or can i call one macro in the other macro?

    It's still very difficult for me to play around the macro(razor) when having different controls in one page.

     

    Can someone help me please?

    Thanks a lot in advance,

    Mitra

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Feb 23, 2015 @ 12:08
    Jeroen Breuer
    0

    Hello,

    What version of Umbraco are you using? Why do you still want to put in a macro? Since Umbraco 7 the default templates are Razor views and you can do it in there instead of a macro. I would also suggest to do all the logic in a controller and only use the view to render html. You can have a look at the Hybrid Framework for some examples.

    Jeroen

  • Mitra 81 posts 196 karma points
    Feb 23, 2015 @ 12:27
    Mitra
    0

    I use Umbraco v6.2.4 

    I have written all of the section in a scripting files and calling them via macro in my template.

    I was wondering if i could move them around and call different scripts in one main script for this page.

     

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Feb 23, 2015 @ 12:38
    Jeroen Breuer
    1

    With this package it's possible to call a macro from inside another macro: https://our.umbraco.org/projects/website-utilities/razor-components

    So with that you call different scripts in one main script.

    Jeroen

  • Mitra 81 posts 196 karma points
    Feb 23, 2015 @ 13:10
    Mitra
    0

    Thank you.

    Do you think it's better i get this package and use different macros for retviring information for one page. like if i put the dropdown for archive year and months in one macro and i pass the info to the main macro.

    The problem is the macro reads once and if i want to pass different argument i'll need to pass the argument through the url and it's not really a good practic, is it?

    Cheers,

    Mitra

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Feb 23, 2015 @ 13:20
    Jeroen Breuer
    0

    You can pass information from 1 marco to another if you want. You can see an example on the package page. Is that what you want/

    Jeroen

  • Mitra 81 posts 196 karma points
    Feb 23, 2015 @ 14:48
    Mitra
    0

    Thank you very much. I am trying to use form's post submit. Meanwhile I'll try to use the package for some other part in my project.

    Thanks,

    Mitra

Please Sign in or register to post replies

Write your reply to:

Draft