首页 \ 问答 \ Joomla:为特定页面加载不同的css(Joomla: Load different css for specific page)

Joomla:为特定页面加载不同的css(Joomla: Load different css for specific page)

我用html和css创建了一个动画,我希望将其包含在joomla网站中。 现在我不想在网站的每个页面上加载此动画的所有css文件。 是否可以在joomla的一个页面上加载此动画的CSS?

谢谢你的帮助!


I created an animation with html and css which i want to include in a joomla site. Now i dont want to load all the css file for this animation on every page of the site. Is it possible to load the css for this animation just on one page in joomla?

Thx for your help!


原文:https://stackoverflow.com/questions/21189053
更新时间:2019-10-29 13:48

最满意答案

尝试...

ScheduledCourse.joins(:course).order('course.name')

如果这不起作用,您可能需要在连接条件之前调用.all ,如下所示:

ScheduledCourse.all.joins(:course).order('course.name')

luacassus说的, 这个答案可以帮助 ; 我认为答案中的语法是Arel(ActiveRecord 3)之前的语法,但它会完成工作。 希望有所帮助!

编辑:

正如@FellowStranger所说,现在的正确语法似乎是

ScheduledCourse.joins(:course).order('courses.name')

Try...

ScheduledCourse.joins(:course).order('course.name')

If this doesn't work, you may need to call .all before your joins condition, like so:

ScheduledCourse.all.joins(:course).order('course.name')

Like luacassus said, this answer can help; I think the syntax in that answer is pre-Arel (ActiveRecord 3), but it'll get the job done. Hope that helps!

EDIT:

As mentioned by @FellowStranger, the correct syntax nowadays seems to be

ScheduledCourse.joins(:course).order('courses.name')

相关问答

更多
  • 尝试... ScheduledCourse.joins(:course).order('course.name') 如果这不起作用,您可能需要在连接条件之前调用.all ,如下所示: ScheduledCourse.all.joins(:course).order('course.name') 像luacassus说的, 这个答案可以帮助 ; 我认为答案中的语法是Arel(ActiveRecord 3)之前的语法,但它会完成工作。 希望有所帮助! 编辑: 正如@FellowStranger所说,现在的正 ...
  • 一个好的起点可能是阅读REST和响应者 然后,从另一个Rails应用程序与API进行交互,可以使用ActiveResource。 这里有一个Railscast 。 一个例子: #API side class ProductsController < ApplicationController respond_to :json def index @products = Product.all respond_with(@products) end end #Client # ...
  • 要删除数据库列,必须生成迁移: script/rails g migration RemoveColumns 然后在self.up类方法中,删除您的列: def self.up remove_column :table_name, :column_name end 您可能希望将它们添加回self.down类方法中: def self.down add_column :table_name, :column_name, :type end “ Rails指南”更详细的介绍。 To remove ...
  • 昨天我开启了一个OAuth2服务器实现 。 它有很好的记录,并且有一个控制访问的仪表板。 现在我正在寻找想要从它开始构建引擎的人,或者是在机架顶部的东西。 这就是为什么它是开源的。 I've opensourced an OAuth2 server implementation yesterday. It's well documented and there is a dashboard to control accesses. Right now I'm searching for somebody w ...
  • 这可能不是最好的解决方案,但你可以做类似的事情 - 5.times do = fields_for 'users[]' do |f| = f.text_field :first_name 然后params[:users]将包含一个数组。 控制器动作看起来像 params[:users].each do |user| User.create!(user) end This is probably not the best solution possible, but you can do ...
  • 我认为你应该将界面逻辑转移到JavaScript中。 这是一个例子: