Skip to content

IDEA: Allow script and style links #62

@mpwoodward

Description

@mpwoodward

(Moved from http://trac.mach-ii.com/machii/ticket/521)

ust hacking around abit, I think it is tedious to have to include all the scripts and style tags, and this could go for all "HEAD" elements.

It would be nice to be able to do the following:

    <page-views>
        <page-view name="home" page="/views/home.cfm">
            <script name="test" />
            <style name="test" />
        </page-view>
        <page-view name="exception" page="/views/exception.cfm" />
        <page-view name="login" page="/views/login.cfm" />
        <page-view name="test" page="/views/login.cfm" type="script" />
        <page-view name="test" page="/views/home.cfm" type="style" display="link" />
    </page-views>

Changed 2 years ago by miketaake@hotmail.com

attachment framework.zip added
ViewManager?.cfc and ViewContext?.cfc in a .zip file.

comment:1 follow-up: ↓ 2 Changed 2 years ago by peterfarrell

Cc kurtwiersma, mattwoodward, brianfitgerald, mikerogers, adrianscott added
Keywords html elements added
Priority changed from blocker to minor
Milestone set to Uncategorized
Thanks for the idea and I appreciate you taking the time to submit an idea. Definitely something the team will discuss.

Have you looked at the new view custom tag library bundled with Mach-II 1.8 which essentially does what you want (just not expressed in XML as they are CFML custom tags)?

comment:2 in reply to: ↑ 1 Changed 2 years ago by anonymous

Replying to peterfarrell:

Thanks for the idea and I appreciate you taking the time to submit an idea. Definitely something the team will discuss.

Have you looked at the new view custom tag library bundled with Mach-II 1.8 which essentially does what you want (just not expressed in XML as they are CFML custom tags)?

Actually, I hadn't, nor had I looked at the HTMLHelperproperty. Both of these will meet the task.

But it would be nice to "wire" into the config files for page-views the dependencies of the views along with scripts, styles, metatags and images, etc. Then, the scripts and styles could be evaluated or linked automagically into the HEAD section.

comment:3 Changed 2 years ago by peterfarrell

We'll discuss the feature request, but with the introduction of view-loaders in 1.8 -- it appears we are getting way from having to define the page-views section of the XML for a convention based approach. Again, the view custom tag library (which behind the scenes is driven by the html helper property) offers everything you need in a CFML based approach.

For scripts/styles that are consistently used, I'd look at the asset packages that the html helper property offers and using a layout subroutine to eliminate repetitive code.

Feel free to bring this up on the Google Group list for more ideas / suggestions on what the community is doing as a whole. The tickets on trac are only monitored by the team and therefore you won't get always get a response as quickly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions