Questions tagged [current-page]

51 questions
47
votes
17 answers

Get current URL/URI without some of $_GET variables

How, in Yii, to get the current page's URL. For example: http://www.yoursite.com/your_yii_application/?lg=pl&id=15 but excluding the $GET_['lg'] (without parsing the string manually)? I mean, I'm looking for something similar to the…
Sebastian
  • 709
  • 1
  • 8
  • 15
27
votes
2 answers

Rails current_page? versus controller.controller_name

I'm implementing current_page? in a view to test if the current controller and action is equal to a certain value, however it won't return true when on that controller/action combination. - if current_page?(:controller => 'pages', :action => 'main')…
iwasrobbed
  • 46,496
  • 21
  • 150
  • 195
11
votes
3 answers

"No routes matches" when using current_page in Rails 3

Has anybody experienced routes mysteriously becoming undetectable when using current_page? in Rails 3? Even with a fully generated scaffold complete with routes, a view, and a controller, I am getting a "No route matches" error. Here's the code: if…
Dan
  • 113
  • 1
  • 5
5
votes
1 answer

can't get rails current_page? method to work with both GET and POST

Given I have the following routes defined in routes.rb get "signup" => "users#new" post "signup" => "users#create" and the following condition in my erb view <%if current_page?(login_path) or current_page?(signup_path)%>

NOW YOU'RE…

user3277633
  • 1,891
  • 6
  • 28
  • 48
4
votes
2 answers

window.open('url', '_self') not working

So i wanted to open a new page replacing the current one, i found that the method should be putting the second parameter on _self but nothing happen... By the way, if i use the _blank parameter or i left it empty it opens in a new page. The rest of…
Poli
  • 89
  • 1
  • 2
  • 8
4
votes
3 answers

Highlight current page navigation link

I've hardcoded a subnavigation and would like to highlight the navbar item of the current page by simply adding a class 'active' to those links. But the following HTML-Markup in combination with the javascript adds the active class to every…
user5991491
3
votes
0 answers

Wordpress Events Manager: personalized single category page lost "current-page-item" CSS class

I have a category of events (A), it has 2 sub-categories(A1, A2). I need to list all its events grouped by sub-categories: Category A Category A1 Some description text Coming events : blabla (these events are sorted by the…
panda
  • 73
  • 1
  • 1
  • 6
3
votes
1 answer

django-cms: attributes and methods available to current page

I have been learning Django-CMS for a while now. I was trying to hook one of my app to a cms page while still using template assigned to it. I came to know that one can retrieve current template from request.current_page object. I searched a lot on…
Asur
  • 1,949
  • 4
  • 23
  • 41
3
votes
1 answer

undefined method `current_page' for # kaminari

Rails 3.2.8 im using kaminari to do pagination, but i keep getting error: undefined method `current_page' for # in posts_controller.rb def index @posts = Post.order(:created_at).page(params[:page]) end in views/posts/index.html.erb <%= paginate…
Nitrino
  • 51
  • 1
  • 3
2
votes
3 answers

Highlighting current page item in the nav menu with jQuery

I've read all about this online but everything else was just overly complicated and I just want to implement a simple code that I can read without going into substrings and all that stuff, so i thought this might be a good challenge for as a noob in…
Ege
  • 1,142
  • 1
  • 8
  • 13
2
votes
1 answer

current_page_item class not added to homepage on wordpress

I am currently working on my own portfolio website using wordpress. I added a custom dynamic menu which links to a couple of category pages and static pages. I have also styled the menu to have a hover and current page state i.e - I changed its…
James
  • 41
  • 2
2
votes
4 answers

How to get the "Page type" for the current page. EPiServer

How can I get the Page Type for the current page. I tried CurrentPage.GetType(); but no success. I need to check if the Page Type equals a specific type in order to do something or not. Thanks
tif
  • 1,109
  • 2
  • 12
  • 32
2
votes
1 answer

How to redirect to the same page with data in codeigniter

I want to redirect to the same page with data array. $this->load->view('view_name',$data); like this how can I refresh the same page with data. please help ?
Ravi Rajindu
  • 380
  • 2
  • 6
  • 23
2
votes
2 answers

Current page class in rails app

I have simple navigation bar in my rails app(Home, News, Contact, etc). And I need to define current page to add :class => 'active'. I find few solution to define current page. And I even created own version. But all of them are reduced to one:
Eugene
  • 689
  • 6
  • 20
2
votes
0 answers

Rails current_page causes 500 error when deployed to Heroku

I have a navigation menu and I want to highlight the links if it or any of its children are active. My menu comprises the following code:
1
2 3 4