TinyMCE template location - tinymce

I've scoured the documentation but to no avail.
Where is src looking at in the settings? Is it the root of the site or the tiny_mce folder?
If my template was located at: /tiny_mce/templates/example.html, what would I put as the SRC?
template_templates : [
{
title : "Editor Details",
src : "editor_details.htm",
description : "Adds Editor Name and Staff ID"
},
{
title : "Timestamp",
src : "blank.htm",
description : "Adds an editing timestamp."
}
],

So it turns out the the location is relative to wherever the script is run from.
So if you are calling the script on the root file (MasterPage in this instance) the code is:
template_templates : [
{
title : "Base Home Page",
src : "/tiny_mce/temp/Base.htm",
description : "Basic Homepage, rotate, etc.."
}
],
So the html file is located in ./tiny_mce/temp/

Related

Docsearch on subpath '/docs' not scraping side navigation

A Docusaurus documentation website: https://slovakia-atmo-plan.marvintest.vito.be/docs/ is rendered in Docs only mode.
The Algolia Docsearch scraper is not scraping root level pages, instead it logs Ignored: from start url. This issue only seems to arise when the Docusaurus build is nested under {baseUrl}/docs.
Why is this being ignored? This is my docsearch config:
{
"index_name": "atmoplan-documentation",
"start_urls": ["https://slovakia-atmo-plan.marvintest.vito.be/docs"],
"sitemap_urls": ["https://slovakia-atmo-plan.marvintest.vito.be/docs/sitemap.xml"],
"sitemap_alternate_links": true,
"stop_urls": ["/tests"],
"selectors": {
"lvl0": {
"selector": "(//ul[contains(#class,'menu__list')]//a[contains(#class, 'menu__link menu__link--sublist menu__link--active')]/text() | //nav[contains(#class, 'navbar')]//a[contains(#class, 'navbar__link--active')]/text())[last()]",
"type": "xpath",
"global": true,
"default_value": "Documentation"
},
"lvl1": "header h1",
"lvl2": "article h2",
"lvl3": "article h3",
"lvl4": "article h4",
"lvl5": "article h5, article td:first-child",
"lvl6": "article h6",
"text": "article p, article li, article td:last-child"
},
"strip_chars": " .,;:#",
"custom_settings": {
"separatorsToIndex": "_",
"attributesForFaceting": ["language", "version", "type", "docusaurus_tag"],
"attributesToRetrieve": ["hierarchy", "content", "anchor", "url", "url_without_anchor", "type"]
},
"conversation_id": ["833762294"],
"nb_hits": 46250
}
Inside your docusaurus.config.js you should set the url parameter with the actual website where you will be hosting your docs. Something like:
module.exports = {
url: 'https://slovakia-atmo-plan.marvintest.vito.be/docs',
[…]
}
This will be used by your docusaurus to generate the sitemap.xml, used by algolia to locate your pages.
REFERENCE: https://docusaurus.io/docs/docusaurus.config.js/#url
DISCLAIMER
I noted something strange inside your sitemap.xml. For example the first link was https://www.vito.be/docs/markdown-page, but defined URL for Algolia is https://slovakia-atmo-plan.marvintest.vito.be/docs.

How to use the same Component view at multiple URLs in Ionic 2’s DeepLinker?

I’m trying to achieve the following configuration in my Ionic (3.9.2) app using the Ionic 2 DeepLinker, where I have regular versions of my pages at index.html, /terms, and /card, and differently styled versions at /club/index.html, /club/terms and /club/card:
#NgModule({
declarations: MyComponents,
imports: [
BrowserModule,
HttpClientModule,
// DeepLinker!!
IonicModule.forRoot(MyApp, { locationStrategy : 'path' }, {
links : [
{ component : HomePage, name : 'Home', segment : '' },
{ component : TermsPage, name : 'Terms of Use', segment : 'terms' },
{ component : CardPage, name : 'Savings Card', segment : 'card' },
// Club Aliases; these pages will have the same content as above,
// but slightly different styles, defined elsewhere.
{ component : HomePage, name : 'Home', segment : 'club' }
{ component : TermsPage, name : 'Terms of Use', segment : 'club/terms' },
{ component : CardPage, name : 'Savings Card', segment : 'club/card' },
//...
Is there a way to achieve this using the Ionic 2 DeepLinker?
Some notes:
We navigate to pages by following links (and preventing default):
Terms of Use
where openPage pushes a page onto the nav stack using NavController's Nav Component, like so:
$event.preventDefault();
this.nav.push(page.component, params);
We also had to setup our webserver to rewrite subdirectories (e.g. “/terms”) to index.html. Info: https://github.com/ionic-team/ionic/issues/10565#issuecomment-282659179
And I also forked #ionic-app-scripts to get this (rewrite to index.html) working on my local development (e.g. live reload) server:
https://github.com/senseijames/ionic-app-scripts
In the DeepLinkConfig links 'name' is simply a string identifier which can be used to resolve the page component by its string alias. I would recommend omitting whitespaces and capitalization and adjusting your implementation like so:
Refactor DeepLinkConfig
links : [
{ component : HomePage, name : 'home', segment : '' },
{ component : TermsPage, name : 'terms', segment : 'terms' },
{ component : CardPage, name : 'card', segment : 'card' },
{ component : HomePage, name : 'club', segment : 'club' }
{ component : TermsPage, name : 'club-terms', segment : 'club/terms' },
{ component : CardPage, name : 'club-card', segment : 'club/card' }
]
Refactor click handler
openPage(name: string, params: any) {
this.nav.push(name, params);
}
Refactor button markup
<button ion-button (click)="openPage('terms', {})">Terms of Use</button>
<button ion-button (click)="openPage('club-terms', {})">Club Terms</button>
<button ion-button (click)="openPage('club-card', { id: 1234, username: 'someuser', rewards: false })">Savings Card</button>
This way you can navigate by name and not have to import page components into each controller in order to link to the page component itself. Also ion-button attribute decorated button elements are the preferred navigation UI per IonicFramework documentation and using them would avoid the need to prevent the default behavior of vanilla html anchors.

sap.m.Shell: sap icon as homeIcon possible?

My UI5 application uses sap.m.Shell as root control. Can the sap icons be used for property homeIcon?
The source text is as follows:
sap.ui.getCore().attachInit(function () {
sap.ui.require([
"sap/m/Shell",
"sap/ui/core/ComponentContainer"
], function (Shell, ComponentContainer) {
new Shell({
app: new ComponentContainer({
height : "100%",
name : "<a name>"
}),
homeIcon : {
'icon': "sap-icon://world",
'phone' : "sap-icon://world",
'phone#2' : "sap-icon://world",
'tablet' : "sap-icon://world",
'tablet#2' : "sap-icon://world",
'favicon' : "sap-icon://world",
'precomposed': false
}
}).placeAt("content");
});
});
Unfortunately the browsers console says:
GET sap-icon://world net::ERR_UNKNOWN_URL_SCHEME
UI5 version: 1.42.9
it is not possible. It is using jQuery.sap.setIcons(oIcons). From the API document
The home icons must be in PNG format...
Also please see another post about Icons.
Thank you.

FancyBox - Open gallery from button

Using fancyBox, I want to open an images gallery clicking on a single button. This is clearly detailed on the site but it doesn't work?! I am not an expert and maybe I am doing something wrong. Here is the code:
HTML:
<a class="open_fancybox" href="image1.jpg">BUTTON</a>
JavaScript:
$(".open_fancybox").click(function() {
$.fancybox.open([
{
href : 'image1.jpg',
title : '1st title'
},
{
href : 'image2.jpg',
title : '2nd title'
},
], {
padding : 0
});
return false;
});
External resources used: jquery.fancybox.js & jquery.fancybox.css
Anyone who knows what's wrong?

How to send an email when a user responds to a comment

What I want is to announce the original comment poster, when someone has responded on his comment
It's a bit blurry on how to do this with triggers.
Has anybody done that, or is there another way to do this?
I'm not sure exactly how to do it with the core Triggers module, but this can definitely be done with the Rules Module (assuming Drupal 6... not sure of any issues with Drupal 7 version of Rules).
Download and install Rules
Navigate to admin/rules/trigger/add to create a new rule, name it whatever you like and under the Event dropdown, choose "After saving a new comment" and click Save
Click on the "Add a condition" link choose "Execute custom PHP code". In the PHP code area, add the following then click save:
if ($comment->pid != 0) {
return TRUE;
}
else {
return FALSE;
}
Click "Add an action" and choose "Load comment by id". In the Comment id field add: <?php echo $comment->pid; ?> and click Save
Click "Add an action" again and choose "Load a user account". In the User id field add: <?php echo $comment_loaded->uid; ?> and click Save
Click "Add an action" again and choose "Send a mail to an arbitrary mail address". In the Recipient field add: <?php echo $user_loaded->mail; ?> and fill in the other fields however you like to customize the email.
Now whenever a comment is replied to, an email will be sent to the "replied-to" comment author.
For Drupal 7 website
Here is the code you can import under rules and update your subject and body as per your requirement:
{ "rules_send_reply_notice_for_comments" : {
"LABEL" : "Send reply notice for comments",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"TAGS" : [ "comments" ],
"REQUIRES" : [ "rules", "comment" ],
"ON" : { "comment_insert" : [] },
"IF" : [ { "NOT data_is_empty" : { "data" : [ "comment:parent" ] } } ],
"DO" : [
{ "mail" : {
"to" : [ "comment:parent:mail" ],
"subject" : "SUBJECT",
"message" : "Here is the message you want to send [comment:body] regards Gaurav",
"from" : "YOUR EMAIL ADDRESS",
"language" : [ "" ]
}
}
] } }