Rendering a custom template in the content area of OrionJS admin section - meteor

I'm using Meteor with OrionJS framework and I have a custom template I want to render in the content area of admin section after clicking a sidebar link I've added with orion.links.add. How should the route look like with FlowRouter? I can't figure it out. Something like this?
FlowRouter.route('/dashboard', {
action: function() {
BlazeLayout.render('orionBootstrapLayout', {content: 'dashboard'});
}
});

Related

Meta tags implementation on MeteorJS

I am maintaining a MeteorJS web app and I need to add some specific meta tags into homepage.
I see that there is a head.html in the project that has all information, including
the existing og meta tags, I tried to add the specific meta tag there and restarted the server.
If I right click view source on the homepage, I can see the newly added meta tag.
However, if I try to use Facebook debugger to see what the FB Crawler sees, the newly added meta tag is not seen by the bot. In fact the bot sees some additional twitter meta tags that does not exist anywhere in the project.
Investigating further, I noticed the project uses a library called
manuelschoebel:ms-seo: https://github.com/DerMambo/ms-seo
This library is initialised in the Meteor.startup like this:
Meteor.startup(function() {
if(Meteor.isServer){
if(Meteor.DEBUG){
robots.addLine('Disallow: /');
}
robots.addLine('Disallow: /admin');
}
if(Meteor.isClient){
// default SEO
return SEO.config({
title: '...',
meta: {
"description": "..."
},
og: {
'image': '....'
}
});
}
Now I am guessing this SEO library is the reason why the bot does not see the newly added meta tag in the head.html.
What is the right way to add the newly meta tag in a clean way? why is this SEO library not respecting the head.html in the project?

NEED HELP - how to make an excerpt of the post clickable?

I am working in Wordpress, and I am using Elementor. Elementor has a native feature for the title of the posts and images to link to the post.
But if I add an excerpt text, it doesn't link to the post. It is not clickable. The read more button does, but not the excerpt of the post.
I am trying to create something like this: greatist.com Every post on their website is clickable - the excerpt, the title, and the image.
My excerpts are really short like on that website, and I would really like them to be clickable. I have absolutely no idea how to do this and I'm beginning to think it's not possible. I am using Hello Elementor theme.
I would deeply appreciate anyone's help. I just registered to ask this question.
You can always try to save text as an photo and make it clickable or make a full section clickable.To do this try to use plugin called "Make Column Clickable Elementor".
Add this code to your website:
const postExcerpts = document.querySelectorAll('.elementor-posts .elementor-post .elementor-post__excerpt');
postExcerpts.forEach(postExcerpt => {
const postUrl = postExcerpt.parentNode.querySelector('.elementor-post__title a').href;
postExcerpt.addEventListener('click', () => {
window.location.href = postUrl;
});
});
This can be added using a script tag. Choose from the following options:
Add this code as a script tag in your functions.php file, to be rendered at the end of the page (wp_footer action hook).
If you have Elementor Pro, use its built-in Custom Code feature to add the code in a script tag to the end of the body tag.
It's recommended to add a pointer cursor so the user will know the excerpt is a link. This can be achieved by adding the following CSS to your style.css file.
.elementor-posts .elementor-post .elementor-post__excerpt {
cursor: pointer;
}

how to put automatically title of page on a slider revolution in wordpress

I am using a slider revolution (in wordpress) in my header. I would like to put automatically the name of each page inside the slider without doing in manually...
I tried to had {{title}} on my slider but does not seem to work...
Any idea ?
Thanks
I found the solution.
Under Module General Options
Content -> Source: Post Based -> Type: Current Post
Updated:
Try this:
1.) Give the layer that will contain the title a class (for example LayerTitle). As I remember, the class of the layer can be set under Advanced option.
2.) All that is left is to add the following jQuery code to set the title to that class:
jQuery(document).ready(
function() {
var title = jQuery(this).attr('title');
$('.LayerTitle').text(title);
}
);
Under Slider Settings --> Content Source, change the type to Current Post/Page. Then {{title}} will display the current page's title.

WooCommerce list view

I have a WordPress site with WooCommerce installed,
The problem I'm having is on the shop page the products are by default shown as a GRID (side by side), there's a button to switch from the default GRID mode to LIST mode; but for every new client that comes on the site, they would have to manually change it!
I'd like to permanently change the default view from GRID to LIST for every person that comes on the site, but I can't find any way to do this in the code.
Does anyone have any knowledge on how to do this?
There is a plugin that can do this for you: http://wordpress.org/plugins/woocommerce-grid-list-toggle
After installing the plugin go to your dashboard: Woocommerce -> Settings -> product -> Scroll to the bottom of the page and there is an option called Default catalog view, change that from Grid to List.
There will be an option for users on the shop page to change the view from List to Grid. To hide this option add the following to the CSS:
.gridlist-toggle
{
display: none !important;
}
My solution can switch grid to list view as default on products page.
You can try this:
Connect to your FTP/public_html/wp-content/YOUR_THEME/woocommerce/global/
Edit wrapper-start.php
You will see this code
$shop_view = shopme_get_meta_value('shop_view');
if (empty($shop_view)) { $shop_view = 'view-grid'; }
if (!empty( $shop_view ) ) { $wrapper_classes[] = $shop_view; }
Replace "view-grid" to "list_view_products"
I just solved the same problem.
This is my solution how to PERNAMENTLY force WooCommerce to show product catalog only as List View.
JS
// This will remove class="grid" on page load and add class="list" to your product view
$(document).ready(function(){
$('.browse-view ul#products').removeClass('grid').addClass('list');
});
JS -- Test with Woocommerce v4.0.1
// -- Last Rev. (2020-04) --
jQuery(function($){
$('.woocommerce ul.products').removeClass('grid').addClass('list');
});
CSS
/* This will hide grid/list switcher in toolbar*/
.view-mode{display:none!important;}
Another way to do this is use this plugin: https://wordpress.org/plugins/gridlist-view-for-woocommerce/
After install go to settings WooCommerce -> Grid/List View
In Buttons tab change Default style to List and uncheck all in Buttons display
In Products Count tab uncheck Use products count

How to add a mailto button to TinyMCE

I need to add a mailto button to TinyMCE in WordPress. Has anybody already done this? Or any tops on how to go about it?
Given you are wanting to put this into WordPress I assume you want to simply insert a href="mailto:" type tag into your document for the currently selected text.
The simplest way is to create a basic plugin. You can do this in the same page that tinyMCE is initialised into. The example below will wrap the currently selected text with a static mailto.
tinymce.create('tinymce.plugins.MailToPlugin', {
init : function(ed, url) {
ed.addCommand('mceMailTo', function() {
var linkText = ed.selection.getContent({format : 'text'});
var newText = "<a href='mailto:foo#bar.com?subject=testing'>" + linkText + "</a>"
ed.execCommand('mceInsertContent', false, newText);
});
// Register example button
ed.addButton('mailto', {
title : 'MailTo',
cmd : 'mceMailTo',
image : url + '/images/mailto.gif'
});
}
});
// Register plugin with a short name
tinymce.PluginManager.add('mailto', tinymce.plugins.MailToPlugin);
You will of course need to create an image (mailto.gif) for the toolbar button.
You then simply add the following to your plugin list
plugins: '-mailto'
and put mailto on the toolbar.
Of course, if you want to allow the end user to specify the email address and subject, then you will need a dialog. There is a good example of how to create a plugin on the TinyMCE site in Creating a Plugin
Unfortunately I can't comment on how you would do either of these in WordPress but I suspect you will need to customise your version of WordPress tinyMCE plugin.
You can use the class I built in WordPress my tutorial and then make the calls to your javascript files through instantiating the class. At least, regarding the reference to adding it to your plugins.
Cheers
First of all, make sure you have tinyMce Advanced plugin installed. Then, you can just use the insert / edit link button from the tinyMce editor. You don't need a different button. In the destination URL add this
mailto:my-mail#my-domain.com

Resources