current-page

How to differentiate if the current page is an EPiServer Page or not

╄→尐↘猪︶ㄣ 提交于 2019-12-23 01:45:37
问题 I need to know if the current page is an EpiServer page or not. I need to know if the current page is the start page, I am using the following line of code. if(PageReference.StartPage.ID == CurrentPage.PageLink.ID) This works perfect on all EPiServers, but when I am on a non EPiServer page then CurrentPage returns values for the StarPage. This means that all my non-EPiServer pages are treated as a StartPage (just in my if statement of course). One solution I thought of is to check first if

Trouble highlighting correct menu parent with wp_nav_menu classes while viewing “single posts”

萝らか妹 提交于 2019-12-13 18:10:04
问题 I just updated a menu on a site of mine to utilize wp_nav_menu. Setting this up with WP was fairly straight forward however I've run into one small snag with the the way wordpress is outputting its parent/ancestor classes for use in highlighting the current page that the content belongs to, particularly with single post pages ... Highlighting the current page with .current_page_item a and .current_page_parent a works perfect as long as its just on a normal page with children, however as soon

Highlighting current page item in the nav menu with jQuery

自作多情 提交于 2019-12-13 16:12:48
问题 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 jquery. I've come up with this code but without success. HTML <ul id="nav"> <li><a href="/" id="home" class="lettering">HOME</a></li> <li><a href="/about" id="about" class="lettering">ABOUT</a></li> <li><a href="/works" id="works" class="lettering

iOS - UIPageControl page indicator dots not changing with UISwipeGestureRecognizer

风流意气都作罢 提交于 2019-12-11 12:09:03
问题 I am using UIPageControl and UISwipeGestureRecognizer to switch between 2 view controllers of my application. I have modified this tutorial without using scroll view. I have 2 issues: 1) Using the swipe gesture is changing the view controllers/pages but not the dots indicating the current page. I have tried if (self.pageControl.currentPage == 0) { self.pageControl.currentPage = 1 } but I am not sure why it does not work. I have the outlet available @property (strong, nonatomic) IBOutlet

jQuery current page via .find() and .each() function

你离开我真会死。 提交于 2019-12-11 05:33:43
问题 I'm trying to make jQuery menu, which can highlight current page. Method is, add class current on selected. Here is html: <div class="menu_items"> <ul class="ul_items" id="navigation"> <li><a href="index.php">1</a></li> <li><a href="index.php?pg=2">2</a></li> <li><a href="index.php?pg=3">3</a></li> <li><a href="index.php?pg=4">4</a></li> <li><a href="index.php?pg=5">5</a></li> </ul> </div> And I tried to make something like that: $(document).ready(function(){ $("#navigation").find("a[href*='"

Get current URL/URI without some of $_GET variables

独自空忆成欢 提交于 2019-12-04 07:40:55
问题 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 Yii::app()->requestUrl / Chtml::link() methods, for returning URLs minus some of the $_GET variables. Edit : Current solution: unset $_GET['lg']; echo Yii::app()->createUrl( Yii::app()->controller->getId().'/'.Yii::app()->controller->getAction()->getId() , $_GET )

Get current URL/URI without some of $_GET variables

对着背影说爱祢 提交于 2019-12-02 15:07:00
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 Yii::app()->requestUrl / Chtml::link() methods, for returning URLs minus some of the $_GET variables. Edit : Current solution: unset $_GET['lg']; echo Yii::app()->createUrl( Yii::app()->controller->getId().'/'.Yii::app()->controller->getAction()->getId() , $_GET ); Felipe Almeida Yii 1 Yii::app()->request->url For Yii2: Yii::$app->request->url Yii::app()-

“No routes matches” when using current_page in Rails 3

試著忘記壹切 提交于 2019-11-29 13:18:47
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 current_page?(:controller => 'users', :action => "show") If I add a "match" command to routes.rb, it works fine, but why would I need to do that if the resources have already been created? What am I missing? You're missing the id parameter from this helper: current_page?(:controller => "users", :action => "show", :id => "1") It expects you to pass a

Rails current_page? versus controller.controller_name

坚强是说给别人听的谎言 提交于 2019-11-28 17:04:13
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') # doesn't return true when on that controller/action combination The only way it is working is if I use a bit more verbose method like so: - if controller.controller_name == 'pages' && controller.action_name == 'main' # this works just fine Is my syntax wrong or is there something else happening here? Is there a better way of doing this, such as

“No routes matches” when using current_page in Rails 3

大兔子大兔子 提交于 2019-11-28 07:14:14
问题 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 current_page?(:controller => 'users', :action => "show") If I add a "match" command to routes.rb, it works fine, but why would I need to do that if the resources have already been created? What am I missing? 回答1: You're missing the id parameter