Need help converting template to mobile browser template.

I need little help converting this attached template file to a template which can be used in mobile browsers also.

All I need is 2 things,
1. proper font sizes so users need not zoom to read on mobiles,
If its possible, font adjusts automatically on laptop screens and does not appears too large.
What font size settings should I use?

2. and the design stretches from left to right automatically so that I can make use of available space.
I do not want the webpage to go beyond horizontal…

Need help converting template to mobile browser template.

Custom taxonomy template list not working (404)

I have created a custom post type ‘item’:

function mywp_add_item_post() {     $  labels = array(         'name' => 'Items',         'singular_name' => 'Item',         'add_new' => 'Add New Item',         'add_new_item' => 'Add New Item',         'edit_item' => 'Edit Item',         'new_item' => 'New Item',         'all_items' => 'All Items',         'view_item' => 'View Item',         'search_items' => 'Search Items',         'not_found' =>  'No Items Found',         'not_found_in_trash' => 'No Items found in Trash',          'parent_item_colon' => '',         'menu_name' => 'Items',         'show_in_nav_menus'=>true     );      $  args = array(         'labels' => $  labels,         'public' => true,         'has_archive' => true,         'show_ui' => true,         'capability_type' => 'post',         'hierarchical' => false,         'rewrite' => array('slug' => 'item'),         'query_var' => true,         'menu_icon' => 'dashicons-randomize',         'show_in_rest' => true,         'show_in_nav_menus'=>true,         'supports' => array('title', 'editor', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'thumbnail', 'author', 'page-attributes'));      register_post_type( 'item', $  args );   }  add_action( 'init', 'mywp_add_item_post'); 

A custom taxonomy named ‘collection’ is added:

function mywp_add_collection_taxonomy() {       $  labels= array('name' => _x( 'Collections', 'taxonomy general name' ),       'singular_name' => _x( 'Collection', 'taxonomy singular name' ),       'search_items' =>  __( 'Search Collections' ),       'all_items' => __( 'All Collection' ),       'parent_item' => __( 'Parent Collection' ),       'parent_item_colon' => __( 'Parent Collection:' ),       'edit_item' => __( 'Edit Collection' ),       'update_item' => __( 'Update Collection' ),       'add_new_item' => __( 'Add New Collection' ),       'new_item_name' => __( 'New Collection Name' ),       'menu_name' => __( 'Collections' ));        $  rewrite= array('slug' => 'collection');    $  args= array('hierarchical' => true,       'show_in_nav_menus' => true,       'has_archive' => true,       'labels'=>$  labels,       'query_var' => true,       'show_in_rest' => true,       'rewrite'=>$  rewrite);     register_taxonomy('collection', 'item', $  args); }  function mywp_tax_filters() {     register_taxonomy_for_object_type('collection', 'item'); }  add_action('init', 'mywp_add_collection_taxonomy', 1); add_action('init', 'mywp_tax_filters'); 

Object: I need a page to view the list of ‘collection’ that are not empty (like the default categories page)

  • A taxonomy template file (taxonomy-collection.php) is created within the theme directory.
  • Permalink structure is flushed.
  • I have added some ‘collections’ assigning ‘items’ inside them.

Problem: The link ‘$ site_url/collection’ shows 404 (not found).

Advance thanks for your thoughts on my problem and your patience to read it all through.

Cannot seem to access Calculated column in Display Template via Managed Property mapping

Here is my situation:

I have a test/development site on SharePoint Online/Office 365 called TestSite3, and within that site a sub-site called TestBlog3 (a Blog site for making Posts).

I want to use a Content Search Web Part on the homepage to query all Post items from the blog, and then sort them by a custom event date value, but then if event date is not specified (it will be optional), use the post’s created date.

I have also made a custom Display Template in which I have the following managed property mappings:

<mso:ManagedPropertyMapping msdt:dt="string">'Picture URL'{Picture URL}:'PublishingImage;PictureURL;PictureThumbnailURL','Link URL'{Link URL}:'Path','Line 1'{Line 1}:'Title','Line 2'{Line 2}:'LastModifiedTime','Line 3'{Line 3}:'BodyOWSMTXT','Line 4'{Line 4}:'RefinableDate03','SecondaryFileExtension','ContentTypeId','IsAllDayEvent'</mso:ManagedPropertyMapping> 

In the Post content type, I have added two custom columns:

  • ZTest3Date: a Date column that is optional to the user to specify, supposed to function as an ‘event date’ for posts about events coming up
  • ZTest3Calculated: a Calculated column returning a Date. What I want is for it to return the event date (ZTest3Date) if it is set, otherwise return the post’s created date (Created).

Here is the formula I have in ZTest3Calculated: =IF(ISBLANK(ZTest3Date),Created,ZTest3Date)

I have seen formulas use brackets [] around the column names, but when I try saving the formula with that it automatically removes them, leaving the above.

I go into the site’s search schema to look at the Managed and Crawled Properties. I use ‘z’ in the search box to filter them down. The ZTest3Date column I made shows up in Managed Properties as ZTest3DateOWSDATE. There is no Managed Property for the ZTest3Calculated column.

In Crawled Properties, I see ows_ZTest3Calculated, ows_ZTest3Date, and ows_q_DATE_ZTest3Date.

I can put ZTest3DateOWSDATE into my Display Template in Line 4 and it works, but that’s only half my solution; I want to handle when there is no event date set.

Since ZTest3Calculated is not available as a managed property, I understand that it is recommended to map the crawled property to one of the pre-set columns SharePoint provides, so I mapped ows_ZTest3Calculated to RefinableDate03.

I have re-indexed the Post list and waited a while, but it does not seem to be working; I have also tried assigning an alias to RefinableDate03 and updating the Display Template, still no luck. When I debug the JavaScript code I put in my display template file to read what is coming into Line 4, it is blank always, whether or not the event date is set. So either the RefinableDate03 mapping isn’t working, or my ZTest3Calculated column isn’t working. Or something else I’m not aware of.

Sorry this is so long, but I feel like supplying the context and my setup is important. I have driven myself crazy with this over the past few days, and would appreciate if someone might have some knowledge of what I’m missing.

I appreciate any help, and thank you for reading all this!

Cannot seem to access Calculated column in Display Template via Managed Property mapping

Here is my situation:

I have a test/development site on SharePoint Online/Office 365 called TestSite3, and within that site a sub-site called TestBlog3 (a Blog site for making Posts).

I want to use a Content Search Web Part on the homepage to query all Post items from the blog, and then sort them by a custom event date value, but then if event date is not specified (it will be optional), use the post’s created date.

I have also made a custom Display Template in which I have the following managed property mappings:

<mso:ManagedPropertyMapping msdt:dt="string">'Picture URL'{Picture URL}:'PublishingImage;PictureURL;PictureThumbnailURL','Link URL'{Link URL}:'Path','Line 1'{Line 1}:'Title','Line 2'{Line 2}:'LastModifiedTime','Line 3'{Line 3}:'BodyOWSMTXT','Line 4'{Line 4}:'RefinableDate03','SecondaryFileExtension','ContentTypeId','IsAllDayEvent'</mso:ManagedPropertyMapping> 

In the Post content type, I have added two custom columns:

  • ZTest3Date: a Date column that is optional to the user to specify, supposed to function as an ‘event date’ for posts about events coming up
  • ZTest3Calculated: a Calculated column returning a Date. What I want is for it to return the event date (ZTest3Date) if it is set, otherwise return the post’s created date (Created).

Here is the formula I have in ZTest3Calculated: =IF(ISBLANK(ZTest3Date),Created,ZTest3Date)

I have seen formulas use brackets [] around the column names, but when I try saving the formula with that it automatically removes them, leaving the above.

I go into the site’s search schema to look at the Managed and Crawled Properties. I use ‘z’ in the search box to filter them down. The ZTest3Date column I made shows up in Managed Properties as ZTest3DateOWSDATE. There is no Managed Property for the ZTest3Calculated column.

In Crawled Properties, I see ows_ZTest3Calculated, ows_ZTest3Date, and ows_q_DATE_ZTest3Date.

I can put ZTest3DateOWSDATE into my Display Template in Line 4 and it works, but that’s only half my solution; I want to handle when there is no event date set.

Since ZTest3Calculated is not available as a managed property, I understand that it is recommended to map the crawled property to one of the pre-set columns SharePoint provides, so I mapped ows_ZTest3Calculated to RefinableDate03.

I have re-indexed the Post list and waited a while, but it does not seem to be working; I have also tried assigning an alias to RefinableDate03 and updating the Display Template, still no luck. When I debug the JavaScript code I put in my display template file to read what is coming into Line 4, it is blank always, whether or not the event date is set. So either the RefinableDate03 mapping isn’t working, or my ZTest3Calculated column isn’t working. Or something else I’m not aware of.

Sorry this is so long, but I feel like supplying the context and my setup is important. I have driven myself crazy with this over the past few days, and would appreciate if someone might have some knowledge of what I’m missing.

I appreciate any help, and thank you for reading all this!

How to create new Document Template for pages library

We have a pages library that has two content types: CustomLink and CustomPage. CustomLink is based on the Link to Document and CustomPage is based on the Page. Both add some metadata, but nothing particularly complex.

We don’t like the current user experience for creating new items in our pages library and are looking to change how that happens. I see that creating a new link goes to _layouts/15/NewLink.aspx. A new page goes either to _layouts/15/CreatePublishingPageDialog.aspx or _layouts/15/CreatePage.aspx depending if the user selects Add a page from the gear menu or New > CustomPage from the library’s listview control bar or Ribbon.

In Library Settings > CustomPage > Advanced Settings I can change the document template. I was able to change the CreatePage one to the CreatePublishingPageDialog and at least now there is only one user experience for creating a new page. One that we don’t like is better than two that we don’t like, but we would prefer to set up our own document template!

I’ve searched for instructions on how to do this, but everything I find is about document libraries and setting up a .dotx or other office template. Like this MS documentation.

I can’t seem to find anything about how to make a document template for a pages library. I’m only a Site Collection owner with now access to _layouts so I can’t even reverse engineer the existing ones.

Anybody know how to create custom document templates for a pages library?

Use a template argument both parsed and unparsed

Suppose I have a simple template Foo

The wikitext   {{{1}}}  renders as  <blockquote>{{{2}}}</blockquote> 

So including {{Foo|<nowiki>'''bold''' and ''italics''</nowiki>|'''bold''' and ''italics''}} in a page renders as

The wikitext

'''bold''' and ''italics'' 

renders as

bold and italics

Is there any way to reduce the duplication required to use template Foo? That is, either modify Foo or call it via another template in such a way that the user only needs to specify the desired wikitext once, instead of two times?

I don’t really care if it would be as

{{DRYFoo|<nowiki>'''bold''' and ''italics''</nowiki>}} 

or

{{FooDRY|'''bold''' and ''italics''}} 

and I’d be satisfied by something that used subst: to expand something else into a normal call to Foo.

The rules for order of evaluation would seem to rule out FooDRY, and I’ve been unable to find a template/parser function that would re-expand wikitext to make DRYFoo work.