English 中文(简体)
ATK4 - subfolder under page folder and js/css issue
原标题:

I am using agile toolkit for one of my projects. When I create a sub folder under page folder, CSS and JS are not picked from atk4 folder and I have to copy those css and js under templates folder. Is this the right way of doing this?

问题回答

Yes. With Agile Toolkit, the files are loaded from atk4/* by default. If you want to override any of those files including templates, css, images, classes or templates, you should copy them outside.

for example:

atk4/template/jui/css/general.css -> template/jui/css/general.css
atk4/lib/Tabs.php -> lib/Tabs.php

If you are including CSS files or linking to images, it s a good practices to use

<?template?>img/myimage.png<?/?>

in your own templates. That instruct Agile Toolkit to locate the resource and links to it properly.

As romans said, you can put your own files in the /templates/default/css folder (It s called jui in 4.0 but default in 4.1) and these should be picked up by the pathfinder.

You can also add additional directories to the list searched by adding them in Frontend.php like this.

$this->addLocation( atk4-addons ,array(
              php =>array(
                    mvc ,
                    misc/lib ,
                    sterling/jqplot/lib ,
                   ),
              css =>array(
                    sterling/jqplot/templates/js/jqplot ,
                   ),

so now the pathfinder will also search for css scripts in the directory specified and i can add the following line into my page code.

$p->api->template->append( css_include ,  <link type="text/css" href=" .$this->api->locateURL( css , mysite.css ). " rel="stylesheet" /> ."
");

Relative path, Look: Some Directory

templates/index.html { `<script src= test.js ></script>` }
index.php

If you want include index.html with test.js you must change relative path - from test.js to templates/test.js edit: look : Click





相关问题
How to start to create an application GUI using C#?

HI! I am new to C# and plan to use it for my application GUI. I am trying to make my GUI similar to SPSS:http://www.spss.com/images/08/statistics_screens/ez_rfm-big.jpg Is this easy in C#? Is there ...

Automatic height of edit box

My shoes application has three items stacked on top of each other (with a stack, of course), in order: A banner An edit box Two buttons in a flow What I want to do is have the banner stay at it s ...

Search by using the keyboard in a list/grid - algorithm

I need to implement a custom search in a grid and I would like to find some user interface guidelines that explain the standard way to implement it. I mean this kind of search that is initiated by ...

UI And TcpClient Issue in vb.net

I m having some problems with a small ircbot i m writing. Basically I connect to the server using a tcpclient in a seperate class, which also runs on its own thread. I want to display the server text ...

UI Convention: Shortcut key for application exit? [closed]

Is there a convention for the shortcut keys for application exit? Some applications uses Alt+X some others use Ctrl+ X and Ctrl+Q. Applications like FF and IE doesnot assign a shortcut at all. So is ...

热门标签