|
|
 Rank: Addict
Joined: 7/29/2006 Posts: 504 Location: Melbourne, Australia
|
Do they work in umbraco? (ie: can i use XSLT in umbraco to get & set properties and call methods in a .Net 2 User control?)
or should i just be coding in .Net 1 until version 3 is out?
Wishes he could work with Umbraco all the time.
|
|
 Rank: Fanatic
Joined: 7/19/2006 Posts: 439 Location: Göteborg, Sweden
|
Yes you can...AFAIN... ;)
" - Yeah I'd like to share your point of view, as long as it's my view too... ( http://www.d-a-d.dk/lyrics/pointofview)
|
|
 Rank: Addict
Joined: 7/29/2006 Posts: 504 Location: Melbourne, Australia
|
so you've never tried it before yourself then?
I'm loving your multiple tabs editing trick kalle. soooo much easier. :)
Wishes he could work with Umbraco all the time.
|
|
 Rank: Fanatic
Joined: 7/19/2006 Posts: 439 Location: Göteborg, Sweden
|
Greg wrote: so you've never tried it before yourself then?
Actually I'm using .Net 2 UserControls in umbraco right now! (In ver 2.1.5) But I haven't tried making a XSLT extension in .Net 2.0 (Actually I've never made an XSLT extension at all ;)) But AFAIK you don't use User Controls AND XSLT macros together, you use one of them. A Macro is either a .Net Control OR a XSLT script // ; ) Kalle
" - Yeah I'd like to share your point of view, as long as it's my view too... ( http://www.d-a-d.dk/lyrics/pointofview)
|
|
 Rank: Addict
Joined: 7/29/2006 Posts: 504 Location: Melbourne, Australia
|
Kalle Wibeck wrote: Actually I'm using .Net 2 UserControls in umbraco right now! (In ver 2.1.5)
But I haven't tried making a XSLT extension in .Net 2.0 (Actually I've never made an XSLT extension at all ;))
But AFAIK you don't use User Controls AND XSLT macros together, you use one of them.
A Macro is either a .Net Control OR a XSLT script
// ; ) Kalle
so you do all of your development logic in .Net user controls? And use Umbraco just for a presentation layer, is that right? What about editing/ adding content to your custom apps? Do you do that through umbraco, or a separate control panel?
Wishes he could work with Umbraco all the time.
|
|
 Rank: Fanatic
Joined: 7/19/2006 Posts: 439 Location: Göteborg, Sweden
|
Yes, that's the way I use it Umbraco for presentation only! The reason for this is that the app we're working on right know handles a massive amount of relational data that isn't that great to store in an XML structure... To add/edit the data I use .Net controls. They sort of live a life of their own inside the umbraco framework... Inside the controls just use the if(Page.isPostBack) and manage your storing logic from there on, the same way you do it in a regular .aspx page. No magic here... // Kalle
" - Yeah I'd like to share your point of view, as long as it's my view too... ( http://www.d-a-d.dk/lyrics/pointofview)
|
|
 Rank: Addict
Joined: 7/29/2006 Posts: 504 Location: Melbourne, Australia
|
Yeah thats how i was thinking of doing my next project (also major relational data involved, so relational database required). Only problems i've thought about (and not sure if there are solutions) are: 1. caching - umbraco won't cache items from an external user control will it? 2. friendly url's - how to implement them using external data? 3. templating for point 3, i was thinking of creating a generic template for each type of page to be displayed. Then that template would call various macros, which would then retrieve the relevant data from the external control. then in the content section of umbraco, there would just be 1 instance of each content type, but how to pass the required content ID to the .Net control? can't use @pageID cos there's only 1 page. see here for more info on my project/ requirements. its starting to make more and more sense, i just want to flesh out as much as possible before diving in and coding.
Wishes he could work with Umbraco all the time.
|
|
 Rank: Fanatic
Joined: 7/19/2006 Posts: 439 Location: Göteborg, Sweden
|
Greg wrote: 1. caching - umbraco won't cache items from an external user control will it? 2. friendly url's - how to implement them using external data? 3. templating
1. I think that umbraco will cache your macros if you tell it so, not sure about the actual data tough... But beware! I read somewhere about a bug related to macro caching... 2. Depends on the application. In my case we have set up a page structure in umbraco and are starting to add the required user controls to them (via the Editor) as the application grows... 3. Works like a charm with our solution at least... Since we use the basic "TextPage" for all controls and pass different text parameters (via public properties) to the controls we can change the behaviour of the control by simlpy editing the macro parameters in the rich text editor... I did that like this: In the ascx.cs add this inside your usercontrol Class: Code:
public string Mode
{
set { _Mode = value; }
}
This will make umbraco autodetect that property when you click the "Browse Properties" button in the macro. Then go to the parameters tab and set the type for the "Mode" param to "text" and voila, when you insert that macro in the Editor you can assign a value to your "Mode" parameter... Did that make any sense to you? // ;) Kalle
" - Yeah I'd like to share your point of view, as long as it's my view too... ( http://www.d-a-d.dk/lyrics/pointofview)
|
|
 Rank: Addict
Joined: 7/29/2006 Posts: 504 Location: Melbourne, Australia
|
Kalle Wibeck wrote: 1.I think that umbraco will cache your macros if you tell it so, not sure about the actual data tough... But beware! I read somewhere about a bug related to macro caching...
hmmm.. not sure what good caching a macro without the data actually is? thanks for the tip about the bug.. i'll watch out for that one.. any idea what happens? Kalle Wibeck wrote: 2. Depends on the application. In my case we have set up a page structure in umbraco and are starting to add the required user controls to them (via the Editor) as the application grows...
so you're making a single page per UC? and that page can display many differnet content items? or are you making a page per content item? Kalle Wibeck wrote: 3. Works like a charm with our solution at least... Since we use the basic "TextPage" for all controls and pass different text parameters (via public properties) to the controls we can change the behaviour of the control by simlpy editing the macro parameters in the rich text editor...
yup this makes sense, but lets say i have a database with 100 different artists. and a single textpage which retrieves artist information via macros (artist details, releases, events, etc), how does umbraco know which artist ID to send to the UC? I suppose this should be included in the links generated by my UC as a querystring or something? but then how to make umbraco retrieve and use that querystring? which then leads back to the old friendlyURL problem... hmmmmm Kalle Wibeck wrote:I did that like this: In the ascx.cs add this inside your usercontrol Class: Code:
public string Mode
{
set { _Mode = value; }
}
This will make umbraco autodetect that property when you click the "Browse Properties" button in the macro. Then go to the parameters tab and set the type for the "Mode" param to "text" and voila, when you insert that macro in the Editor you can assign a value to your "Mode" parameter... Did that make any sense to you? yup, thats all good for selecting the type of content to display, but what about the actual content item? my site will be fully content managed by the users on the front end, so i wont be adding a content item for each new entry in umbraco, unless i make user submissions add the new content item, as well as the extra info into my external database... so when a user submits a new content item, it will create that item in umbraco with basic info (basically just a pointer to the external DB record), and write the extended info to my external DB. i guess i could do that using autoform (to add the umbraco content item), and then an actionhandler on submission of the autoform to then call another form (from my UC) which then promts the user to enter the extended data. does this make sense? phew, its tricky... but i guess this way i'll still have friendly URLs. does this soudn feasable, or am i missing something? thanks for all the advice.. its really helping me get my head aroudn how i'm going to do it all... as is my current project (creating a small website for my cousin - which is also clearing up alot of misconceptions in my mind about how umbraco works). cheers greg
Wishes he could work with Umbraco all the time.
|
|
 Rank: Umbracoholic
Joined: 7/20/2006 Posts: 1,069 Location: Charleston, West Virginia, United States
|
Greg wrote:yup this makes sense, but lets say i have a database with 100 different artists. and a single textpage which retrieves artist information via macros (artist details, releases, events, etc), how does umbraco know which artist ID to send to the UC? I suppose this should be included in the links generated by my UC as a querystring or something? but then how to make umbraco retrieve and use that querystring? which then leads back to the old friendlyURL problem... hmmmmm You can pass a parameter through the querystring and have the usercontrol pick it up in a multitude of ways. Passing [@param] through the macro to a public property is the built-in method, but having the usercontrol read the querystring is just as easy. Hope this helps. Case
• 2007/2008 MVP • 2008/2009 MVP • Core Developer • Certified Professional Level I & II •
|
|
 Rank: Addict
Joined: 7/29/2006 Posts: 504 Location: Melbourne, Australia
|
Casey Neehouse wrote: You can pass a parameter through the querystring and have the usercontrol pick it up in a multitude of ways. Passing [@param] through the macro to a public property is the built-in method, but having the usercontrol read the querystring is just as easy.
Hope this helps.
Kinda, sorta, a little bit. hmmmm. The best way i can think of to handle external database data would be to create a content item in Umbraco for every external database item (ie: for each artist in the DB, there'll be an Artist item in Umbraco, and the umbraco pageID will be recorded against that artists record in the external DB, and passed to the UC as a parameter so the UC knows which artist details to retrieve)... that way i'll get the benefit of friendly url's from umbraco, and the ability to manage permissions etc from within the umbraco management console, using the external DB only to store the extra relational data that is difficult to do within umbraco. The passing that parameter to the UC through various macros will enable me to retrieve the data from other tables in my DB that are related to the parameter being passed. Does this make sense so far? BUT, then there's that old content items limit in umbraco.. what happens when i hit that 30,000 item limit? and is tehre a way around it? (version 3 perhaps)? Thanks again guys.. i'm sure lots of people will benefit from this discussion, and open umbraco up to lots of developers who just havent' thought through this yet. Perhaps i should document how i did all of this, for the benefit of future developers? that said, lets keep the dialog going. ;)
Wishes he could work with Umbraco all the time.
|
|
 Rank: Umbracoholic
Joined: 7/20/2006 Posts: 1,069 Location: Charleston, West Virginia, United States
|
Friendly URLs would be nice, but at present there is no way of triggering the URL parsing routine to stop at a specific node (terminal node) and to allow the remaining url content to be passed into the page as parameters for the user controls and macros. If someone had a way of manipulating this, it could be quite useful for many other things including content reuse. The profile stuff in umbraco kinda does this, but I am not sure exactly what happens. Maybe you could write a aspx page that consumes umbraco and renders a specific page and template, and parses the url and passes the parameters to the user control, but avoids the url parsing by umbraco by specifying it in the config file. Confused yet -- I am.. Case
• 2007/2008 MVP • 2008/2009 MVP • Core Developer • Certified Professional Level I & II •
|
|
 Rank: Addict
Joined: 7/29/2006 Posts: 504 Location: Melbourne, Australia
|
phew... you just confused me too casey.
i think the friendly url's would work in my solution, by creating a separate content item for each database record, which acts as a pointer to the corresponding record in the external DB.
can anyoen see anything wrong wtih this approach?
Wishes he could work with Umbraco all the time.
|
|
 Rank: Umbracoholic
Joined: 7/20/2006 Posts: 1,069 Location: Charleston, West Virginia, United States
|
The only thing I see wrong with that is the fact that you are duplicating the database. That is a lot of upkeep, and as such, a big headache. Hmm, I have some ideas, but about all of them consist of modifying the core code.
• 2007/2008 MVP • 2008/2009 MVP • Core Developer • Certified Professional Level I & II •
|
|
 Rank: Addict
Joined: 7/29/2006 Posts: 504 Location: Melbourne, Australia
|
Casey Neehouse wrote: The only thing I see wrong with that is the fact that you are duplicating the database. That is a lot of upkeep, and as such, a big headache. not if i store only VERY basic details in the umbraco form (ie: a foreign key that relates to my DB, and the item name, which will generate the friendlyURL). This will then enable me to manage member groups etc from within Umbraco, and permissions to resources etc.
Is my logic at least sound here?
[quote=Casey Neehouse] Hmm, I have some ideas, but about all of them consist of modifying the core code.
.. something i'm not very keen on at all... unless it becomes part of the core product. are they huge modifications, or just little ones? so it seems my requirements actually are challenging the boundaries of umbraco (well for what it was built to do anyway). that definitely makes me feel a bit better about my time taken to get my head around it. :)
Wishes he could work with Umbraco all the time.
|
|
 Rank: Addict
Joined: 7/29/2006 Posts: 504 Location: Melbourne, Australia
|
Dammit... sorry ignore my prevous post, here's how it was supposed to come out Casey Neehouse wrote: The only thing I see wrong with that is the fact that you are duplicating the database. That is a lot of upkeep, and as such, a big headache.
not if i store only VERY basic details in the umbraco form (ie: a foreign key that relates to my DB, and the item name, which will generate the friendlyURL). This will then enable me to manage member groups etc from within Umbraco, and permissions to resources etc. Is my logic at least sound here? Casey Neehouse wrote: Hmm, I have some ideas, but about all of them consist of modifying the core code.
.. something i'm not very keen on at all... unless it becomes part of the core product. are they huge modifications, or just little ones? so it seems my requirements actually are challenging the boundaries of umbraco (well for what it was built to do anyway). that definitely makes me feel a bit better about my time taken to get my head around it. :)
Wishes he could work with Umbraco all the time.
|
|
 Rank: Umbracoholic
Joined: 7/20/2006 Posts: 1,069 Location: Charleston, West Virginia, United States
|
Depending on your exact situation and intent on using member groups, your method may be the best. If you were listing a database of books and authors, I would consider something different, as you will always be adding, deleting, and updating content in multiple places. The modification I was mentioning is to modify the page lookup routine that parses the url and executes an xpath statement to find the page. My thought was to have a keyword or symbol in the url that would trigger the parse routine to break, and find the page at that point. Your control could then parse the remainder of the url to find what you are looking for. IE - symbol: Books/Author/~King,Stephen.aspx and Books/Book/~Carrie.aspx or keyword: Books/Author/byname/King/Stephen.aspx where "byname" is the keyword. I personally like the symbol approach, as it looks a lot cleaner. However, the keyword approach could be more defining in which process to execute. A combination of both could be quite powerful as well. The keyword approach has more overhead though. One thing to keep in mind, you may want to incorporate the ID into the url that you are looking up, as there may be multiple books named "Carrie". Let me know what you decide. Case
• 2007/2008 MVP • 2008/2009 MVP • Core Developer • Certified Professional Level I & II •
|
|
 Rank: Addict
Joined: 7/29/2006 Posts: 504 Location: Melbourne, Australia
|
hmmm... i'll need to think about this a bit. my brain is too mashed right now to process all of this (long week). i'll revisit this over the weekend or next week.
thanks for your input - muchly appreciated greg
Wishes he could work with Umbraco all the time.
|
|
 Rank: Addict
Joined: 7/29/2006 Posts: 504 Location: Melbourne, Australia
|
Okay, I've had a little time to digest this... and think more about it. so here goes... Casey Neehouse wrote: Depending on your exact situation and intent on using member groups, your method may be the best.
If you were listing a database of books and authors, I would consider something different, as you will always be adding, deleting, and updating content in multiple places.
Well, i will be doign this anyway. Mine is music artists, artist profiles, album releases, record label profiles and releases, events where artists are playing, event promoter profiles, etc... all relational (so an artist page will show related releases, events, labels, etc; event page will show related artists, promoters, etc). BUT, and the big BUT here, is that all the additions will be done by the users, not the umbraco administrators or editors. This is why i think custom user controls would be best. and the relational manner of the data. Casey Neehouse wrote: The modification I was mentioning is to modify the page lookup routine that parses the url and executes an xpath statement to find the page. My thought was to have a keyword or symbol in the url that would trigger the parse routine to break, and find the page at that point. Your control could then parse the remainder of the url to find what you are looking for.
Yup, i get what you're saying. Problem here is i'll lose the SEF URLs. not made about that idea. Casey Neehouse wrote: IE - symbol: Books/Author/~King,Stephen.aspx and Books/Book/~Carrie.aspx or keyword: Books/Author/byname/King/Stephen.aspx where "byname" is the keyword.
Case in point. I prefer: Books/Penguin/StephenKing/Cujo.aspx - i can achieve this using native umbraco content nodes, which when called will then call a macro, pass the pageID to the macro, whcih will then use that PageID to pass to my usercontrol which will then get the rest of the details for Cujo. It can also call another macro which returns items related to Cujo (other books by Stephen King, other Books on Penguin Publishing, etc). Make sense? Are you saying I wont be able to use my approach, or are you saying your approach would avoid creating data in 2 locations (all data in my UC/DB, and a pointer in Umbraco)? Casey Neehouse wrote: I personally like the symbol approach, as it looks a lot cleaner. However, the keyword approach could be more defining in which process to execute. A combination of both could be quite powerful as well. The keyword approach has more overhead though.
I prefer neither :P Just ensuring my idea is not flawed to start with (?) Casey Neehouse wrote: One thing to keep in mind, you may want to incorporate the ID into the url that you are looking up, as there may be multiple books named "Carrie".
well if thats the case, then using the Umbraco SEF URLs, the second Carrie book would get renamed to Carrie1 or something similar, would it not? I think we're getting close. :) yaaaay.
Wishes he could work with Umbraco all the time.
|
|
|
Guest |