Re: [WebDNA] feature suggestion - long response
This WebDNA talk-list message is from 2011
It keeps the original formatting.
numero = 106796
interpreted = N
texte = Sorry I don't follow your explanation, maybe I'm too tired.Sincerely,Kenneth Grome> that's a great question!> > I'm in the middle of rewriting my e-commerce platform to> be moderately MVC (Model-View-Controller) instead of the> spaghetti code that it currently is. (I haven't solved> the m part of mvc, but I will)> > > =======> I'm willing to go out on a limb and say that most people> using webdna do this:> > (mypage.tpl)> HAS_WEBDNA_TAGS> some logic code> database lookups, appends, whatever> > html headers> (some webdna variables used here)> > body> [include pagetop]> the html of the page> webdna searches> various variables used> if you're a really sloppy coder... more logic intermixed> [include pagebottom]> /body> > maybe some more webdna code> (/mypage.tpl)> > > =======> my new way:> > (mypage.tpl) (the controller)> HAS_WEBDNA_TAGS> include some function files as needed> > business logic in webdna code.> assign variables as will be needed in the html view> (i'm trying very hard not to cheat and put searches in> the html - as part of transitioning some code to access> sql databases)> > [include templates/mypage.html]> (/mypage.tpl)> > > (mypage.html) (the view)> [text]title=the page title[/text]> > [text]sidebar=whatever is in the sidebar[/text]> > [text]content= all the html that is shown in the content> area of the page[/text]> > [include base.html]> (/mypage.html)> > +++++KEN, here's why: +++++> > (base.html) (the master page template)> html> header>
[showif [? title]=T][title][/showif][showif [?> title]=F] generic page title[/showif] /headers> > body> div sidebar> [showif [? sidebar]=T][sidebar][/showif][showif [?> sidebar]=F] generic sidebar[/showif] /div> div cotent> [showif [? content]=T][content][/showif]> /div> /body> /html> (/base.html)> > this is basically a ginormous borrowing (as close as I> have bothered to develop) of Django's template system,> their extend tag, and content_blocks.> > My base template is always clean, & nicely balanced ("did> i close that div tag in footer.inc?")> > Hope this helps explain why i don't want to preset> variables if i don't need to.> > On Jun 22, 2011, at 7:16 PM, Kenneth Grome wrote:> > If all you're doing is checking to see if a variable> > exists, why not do this?:> > > > [text]abc=123[/text]> > [text]def=[/text]> > > > [showif [abc]!]this stuff is shown[/showif]> > [showif [def]!]this stuff is hidden[/showif]> > > > All it takes is presetting the vars at the top of the> > page, then you don't have to screw around with [raw]> > or [interpret] ... or some new syntax that would> > require WebDNA to be rewritten.> > > > I've done this for years, it is so efficient and> > effective that I've never needed anything else. You> > don't even have to [url] the variable tags when you do> > it this way!> > > > Sincerely,> > Kenneth Grome> > ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list
.> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> Bug Reporting: support@webdna.us
Associated Messages, from the most recent to the oldest:
Sorry I don't follow your explanation, maybe I'm too tired.Sincerely,Kenneth Grome> that's a great question!> > I'm in the middle of rewriting my e-commerce platform to> be moderately MVC (Model-View-Controller) instead of the> Spaghetti code that it currently is. (I haven't solved> the m part of mvc, but I will)> > > =======> I'm willing to go out on a limb and say that most people> using webdna do this:> > (mypage.tpl)> HAS_WEBDNA_TAGS> some logic code> database lookups, appends, whatever> > html headers> (some webdna variables used here)> > body> [include pagetop]> the html of the page> webdna searches> various variables used> if you're a really sloppy coder... more logic intermixed> [include pagebottom]> /body> > maybe some more webdna code> (/mypage.tpl)> > > =======> my new way:> > (mypage.tpl) (the controller)> HAS_WEBDNA_TAGS> include some function files as needed> > business logic in webdna code.> assign variables as will be needed in the html view> (i'm trying very hard not to cheat and put searches in> the html - as part of transitioning some code to access> sql databases)> > [include templates/mypage.html]> (/mypage.tpl)> > > (mypage.html) (the view)> [text]title=the page title[/text]> > [text]sidebar=whatever is in the sidebar[/text]> > [text]content= all the html that is shown in the content> area of the page[/text]> > [include base.html]> (/mypage.html)> > +++++KEN, here's why: +++++> > (base.html) (the master page template)> html> header> [showif [? title]=T][title][/showif][showif [?> title]=F] generic page title[/showif] /headers> > body> div sidebar> [showif [? sidebar]=T][sidebar][/showif][showif [?> sidebar]=F] generic sidebar[/showif] /div> div cotent> [showif [? content]=T][content][/showif]> /div> /body> /html> (/base.html)> > this is basically a ginormous borrowing (as close as I> have bothered to develop) of Django's template system,> their extend tag, and content_blocks.> > My base template is always clean, & nicely balanced ("did> i close that div tag in footer.inc?")> > Hope this helps explain why i don't want to preset> variables if i don't need to.> > On Jun 22, 2011, at 7:16 PM, Kenneth Grome wrote:> > If all you're doing is checking to see if a variable> > exists, why not do this?:> > > > [text]abc=123[/text]> > [text]def=[/text]> > > > [showif [abc]!]this stuff is shown[/showif]> > [showif [def]!]this stuff is hidden[/showif]> > > > All it takes is presetting the vars at the top of the> > page, then you don't have to screw around with [raw]> > or [interpret] ... or some new syntax that would> > require WebDNA to be rewritten.> > > > I've done this for years, it is so efficient and> > effective that I've never needed anything else. You> > don't even have to [url] the variable tags when you do> > it this way!> > > > Sincerely,> > Kenneth Grome> > ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> Bug Reporting: support@webdna.us
Kenneth Grome
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
Mac v. NT (1998)
$Replace with [founditems] (1997)
Date problems (1997)
creator code (1997)
FirstClass/WebCatalog (1999)
Showcart in [include] (1999)
WebCat2: Found Items syntax, etc. (1997)
Add to a field (1998)
WebCat & WebTen (1997)
Anyone Using 4DMail (2004)
Mac: [ListFiles] bug alert (1997)
target=_blank and form variables (1997)
WC1.6 to WC2 date formatting -FIXED! (1997)
Prices coming up 0.00 (2001)
Cookie still not working (1999)
Why did this copyfile stop working? (2004)
WebDNA with WebStar V (2003)
WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997)
multiple search commands (1997)
[QuantityPrice] Not working in WebCatNT 2.0.1??? (1997)