Copied to clipboard

Flag this post as spam?

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


  • Shiraj 47 posts 125 karma points
    Jul 25, 2013 @ 11:36
    Shiraj
    0

    How to add macro for seperate pages

    Hi,

    I have few pages already created.Each page I have a right side bar which contains some dynamic data comming form database.All these right side bar content are specific for each and every page.I have done this in my website by reading the page name and dispalaying right side content.

    So now I need to do the same in Umbraco.Here how I did this.

    - I created seperate macros for each page.

    - Created Macro container property for page

    - Added relevent macro to page

    - Use this code in Masterpage

     <umbraco:Macro Alias="pageName" runat="server"></umbraco:Macro>

    I know in last step there is a problem.Now every page showing same macro.

    How can I use relevant macro in correct page? I guess something need to change in Mater page?

    Thanks

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 25, 2013 @ 12:08
    Jan Skovgaard
    0

    Hi Shiraj

    May I ask why you have created seperate macroes? Do you read different information from different properties on a document?

    Or do you need to display different macroes dependant on the page type? If so does the different page types have different templates assigned to them?

    Feel free to post some screendumps of your template structure etc.

    /Jan

  • Shiraj 47 posts 125 karma points
    Jul 25, 2013 @ 12:16
    Shiraj
    0

    Hi Jan,

    I have 3 kind of master pages.Home.master and Inner.master and one for Grid

    Except Home page other pages uses Inner.master.Every page have same contents needed to edit.Like Title,Content,Page image.

    Every page has a section to display diffrent PDF files which is uploaded from backend(I am converting existing .net site to Umbraco).Meaning each page will have different PDF files.

    So I thought if I can use seperate macro for each page? I am very new to Umbraco if you guys can tell me the way to accomplish this that would be great.

    Thanks

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 25, 2013 @ 12:19
    Jan Skovgaard
    0

    Hi Shiraj

    Where does the information for "Bestyrelse" and "Personale" macroes come from?

    /Jan

  • Shiraj 47 posts 125 karma points
    Jul 25, 2013 @ 12:32
    Shiraj
    0

    from SQL server database.I have made a .asxc file and uses it as a macro

    There is only a gridview.It looks like this



  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 25, 2013 @ 13:39
    Jan Skovgaard
    0

    Hi Shiraj

    Ok, but then the current approach you have taken should be fine I guess?

    When you're rendering the content from the property of your macro container it will simply display the content from the chosen macro, right?

    /Jan

  • Shiraj 47 posts 125 karma points
    Jul 25, 2013 @ 14:16
    Shiraj
    0

    Hi Jan,

    Yes I guess the approach is fine.But the way I render the macro seems not correct.

    Its allways showgin same macro.As I have defined it.Otherwise i have to use master pages for each and every page?

    can you pls let me know any solution for master page

    <umbraco:Macro Alias="pageName" runat="server"></umbraco:Macro>

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jul 25, 2013 @ 14:24
    Jan Skovgaard
    0

    Hi Shiraj

    What does the content of your macro with the alia "pageName" look like? It should not be neccesary to have different templates for this at all.

    /Jan

  • Shiraj 47 posts 125 karma points
    Jul 25, 2013 @ 14:33
    Shiraj
    0

    Hi Jan,

    alias "PageName" will be the macro alias

    Ex: alias="personale"

    is there a way to define macro in tempalte file and can refer relevant macro from page

  • Shiraj 47 posts 125 karma points
    Jul 26, 2013 @ 13:05
    Shiraj
    0

    I have solved this
    Thanks Jan

Please Sign in or register to post replies

Write your reply to:

Draft