logo
down
shadow

How to get a list of sibling pages in Kentico


How to get a list of sibling pages in Kentico

Content Index :

How to get a list of sibling pages in Kentico
Tag : asp.net-mvc , By : JSebok
Date : November 29 2020, 04:01 AM

hop of those help? I'd say you want get children of the current document parent on the same level, let say you have CurrentDocument:
    var docs = DocumentHelper
        .GetDocuments()
        .OnSite("CorporateSite")
        .Culture("en-US")
        .Where(d => d.NodeParentID == CurrentDocument.NodeParentID && d.NodeLevel == CurrentDocument.NodeLevel)
        .OrderBy(d => d.DocumentName);

    // Go through the documents 
    foreach (var document in docs)
    {
        Response.Write(HTMLHelper.HTMLEncode(document.DocumentName) + "<br />");
    }

Comments
No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

List Sibling Pages By Tag


Tag : php , By : Dean
Date : March 29 2020, 07:55 AM
it should still fix some issue I believe I may have come up with an answer. This code may be a little rough, but as far as I can tell it works as needed:
<?php 
if($post->post_parent):
  $postparent = $post->post_parent;
else: 
  $postparent = $post->ID;
endif; 

$nextTagThumb='-1';
$tags = wp_get_post_tags($postparent);
foreach ($tags as $tag) :

  if ($tags) {
    $what_tag = $tags[($nextTagThumb+'1')]->term_id;
    $tag_title = $tags[($nextTagThumb+'1')]->name;
    echo '<div class="Saving_sare">'. "\n";
    echo '<h4>'.$tag_title.'</h4>'. "\n";
    echo '<ul>'. "\n";
    $args=array(
      'tag__in' => array($what_tag),
      'post__not_in' => array($postparent),
      'showposts'=>100,
      'caller_get_posts'=>1
    );
    $my_query = new WP_Query($args);
    if( $my_query->have_posts() ) {
      while ($my_query->have_posts()) : $my_query->the_post(); ?>
        <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
      <?php endwhile;
    }
    echo '</ul>'. "\n";
    echo '</div>'. "\n";
    wp_reset_query();
    $nextTagThumb = ($nextTagThumb+1);
  }
endforeach; 
?>

List children pages, unless none exist, in which case, list sibling pages, in WordPress


Tag : php , By : MikeW
Date : March 29 2020, 07:55 AM
will help you I have a navigation structure like this: , this should either do it outright or at least show you how:
<?php
$output = wp_list_pages('echo=0&depth=1&title_li=<h2>Top Level Pages </h2>' );
if (is_page( )) {
  $page = $post->ID;
  if ($post->post_parent) {
    $page = $post->post_parent;
  }
  $children=wp_list_pages( 'echo=0&child_of=' . $page . '&title_li=' );
  if ($children) {
    $output = wp_list_pages ('echo=0&child_of=' . $page . '&title_li=<h2>Child Pages</h2>');
  }
}
echo $output;
?>

Kentico V9 CSS List Menu webpart for 2nd and 3rd level pages


Tag : development , By : Arun Thakkar
Date : March 29 2020, 07:55 AM
With these it helps Use /% for a path. ../% is a relative path.
See more details in documentation.

List Kentico 7 published pages


Tag : sql-server , By : jonagh
Date : March 29 2020, 07:55 AM
hope this fix your issue I inherited a CMS with some pages that are hidden or archived with published pages beneath those and I'm trying to get a scope for pages that are available to be viewed that are linked via other pages in the site. I'm trying to distinguish between pages that have a "path" to them and those that are published but only directly accessible via URI. , This query should get you what you're looking for.
SELECT *
FROM View_CMS_Tree_Joined
WHERE (NodeLinkedNodeID IS NULL OR NodeLinkedNodeID <= 0)
    AND Published = 1

List of pages in Kentico


Tag : chash , By : picamiolo
Date : March 29 2020, 07:55 AM
I wish this helpful for you No hack about what you posted. In the documentation here and ObjectQuery documentation here it also shows another way to get your information:
// Creates an instance of the Tree provider
TreeProvider tree = new TreeProvider(MembershipContext.AuthenticatedUser);

// Gets the published version of pages stored under the "/Articles/" path
// The pages are retrieved from the Dancing Goat site and in the "en-us" culture
var pages = tree.SelectNodes()
    .ClassNames("custom.CustomPressRelease")
    .Path("/Articles/", PathTypeEnum.Children)
    .WhereLike("DocumentName", "Coffee%")
    .Columns("NodeAliasPath", "DateIssued", "ContentTitle", "TeaserText", "GeoCoverage")
    .OnSite("DancingGoat")
    .Culture("en-us");
Related Posts Related QUESTIONS :
  • DecimalDynamicDisplayFormat constant expression error
  • Property injection upon initializing object manually
  • how to force partial view to render proper url
  • Identity can't connect to remote DB, keep connecting to local DB
  • How to use c# inside mvc razor pages
  • Reasons not to increase maxQueryStringLength?
  • asp.net mvc exclude an action from search engine crawling
  • Best Way to reuse code inside my Controller action method
  • BEM and asp.net mvc
  • RazorPDF save pdf file to server directory in MVC4
  • Controller Unit Testing with model validation
  • How to bind input field to editfor model MVC
  • WebGrid all buttons submits the form
  • How can I restrict access to a view only to two specific users each time in MVC?
  • Kendo UI Grid data bind to two table DB
  • How to modify CRUD operations with Entity Framework in .NET MVC application
  • ModelBinding Issue with a Struct
  • Web Api with & causing an error
  • dropdownlistfor selected value with viewdata
  • MVC 4 dropdownlist in edit form doesnt give the correct value after edit command from grid
  • Trying to move asp.net identity tables to my database
  • issue in adding elements into a list in mvc
  • IActionFilter class can only find physical attributes, not ones added in GlobalFilters config
  • ASP.NET MVC Bug with Model Binding: "Specified cast is not valid" when no data provided for dictionary
  • How to host ASP.NET MVC app on IIS10 win10
  • Get mongodb subDocument
  • SimpleMembershipProvider specify to use hash SHA512, something went wrong
  • How to bind a WebGrid in a PartialView, which is in JQueryUI ModalPopup
  • MVC Membership.UpdateUser(u); Specified method is not supported
  • How to reuse class in models without using validation for all of them
  • Null property in object recovered by EF
  • How to set routing to have some controller actions handled by angular
  • ads while debugging mvc website
  • Use partial views for custom MVC html controls
  • Does editing a Web.config file trigger an overlapping recycle or a start+stop of the application pool?
  • Refreshing my DataTable model and view every few seconds
  • Razor TextBoxFor name and value
  • Session and user authentication using ASP Identity
  • MVC: Should we have any if else OR other logical statement in View?
  • ASP.NET Core Capturing POST data
  • How can i delete multi selected records using checkbox in Kendo Grid?
  • 404.15 not found MVC4 RazorJS
  • Can't seem to get MvcSiteMapProvider to work with routes that have route values
  • ASP.NET Identity and Claims
  • Rejecting an otherwise successful ws-federation login in a CookieAuthenticationProvider()
  • Is it possible to run a java script in a partial view in MVC 5?
  • Passing selected value from the radio buttons to the controller in MVC
  • TFS:The "Microsoft.Reporting.RdlCompile" task could not be loaded from the assembly Microsoft.ReportViewer.Web
  • Uploaded Image not a Display in my Grid View
  • Bind viewmodel to partial view
  • ASP.NET MVC 4 Forms Birthday box
  • Client side validation doesn't work for the dropdown
  • How to set first checkbox checked in mvc
  • ViewModel in postback to controller is null
  • How does StackExchange API implements the common wrapper object?
  • HTML ListBox name for data binding in ASP.Net mvc
  • Div's visibility based on model property in mvc
  • Cant publish asp.net with web deploy onto IIS
  • Information about form sender - ASP.NET MVC
  • MVC Route With *parameters Not Matching With Only One Argument
  • shadow
    Privacy Policy - Terms - Contact Us © scrbit.com