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 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.
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
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
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
Hi Shiraj
Where does the information for "Bestyrelse" and "Personale" macroes come from?
/Jan
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
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
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>
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
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
I have solved this
Thanks Jan
is working on a reply...