Since I never worked with Orchard CMS I have a SEO related question.. is it possible to have title of a page/ article like: title of a page/article | title of website | website url? Because what I have now is backwards order.. Tnx in advance
In your theme you need to overwrite Document.cshtml
The original can be found here:
~/Core/Shapes/Views/Document.cshtml
The title is added to the page using:
#{
var title = Convert.ToString(Model.Title);
var siteName = Convert.ToString(WorkContext.CurrentSite.SiteName);
var baseUrl = Convert.ToString(WorkContext.CurrentSite.BaseUrl);
}
#Html.Title(baseUrl, siteName, title)
You can add as many parameters in the Title helper method as you want and they will be shown separated by the separator specified in site settings. They are displayed in reverse order.
So:
<title>#Html.Title("Item 1", "Item 2", "Item 3")</title>
will be rendered in HTML as:
<title>Item 3 - Item 2 - Item 1</title>
Related
I'm a complete Modx newbie and I'm trying to update an existing website. My goal is to add a new category to some pages as shown in the table below:
Checkout the documentation for this here https://bobsguides.com/creating-a-new-category.html
To create a new Category
Click on the Elements tab in the tree at the left in the Manager
Right-click on the "Categories" folder in the Element tree
Select "New Category"
Enter a Name for your new Category
(Optional) Enter a parent Category if you want to have Categories within Categories
It seems your question about MIGX TV functionality, this is how you should solve this:
Update your MIGX TV with the next category field (in Form tabs):
{"field":"category", "caption":"category", "inputTVtype":"listbox",
"inputOptionValues":"#EVAL return $modx->runSnippet('getCategoryList');"}
Create snippet getCategoryList with next code inside:
<?php
$result = array();
$c = $modx->newQuery('modCategory');
$c->sortby('category','ASC');
$categories = $modx->getCollection('modCategory',$c);
foreach($categories as $category){
$result[] = $category->get('category')."==".$category->get('category');
}
return implode("||", $result);
First part of the question is I want to simply change the original buttons "First", "Prev" and so on to some other text.
here is a link that shows original btns.
My second part of the question is how can i display the pagination in a footer out side the table
such as:
<table></table>
<div class:"footer">
pagination
</div>
There are several options you can use to change the pagination setup
Button Text
If you are looking to change the text, then the localisation system allows you to change any text for any part of the table, for full details see the Localization Documentation
var table = new Tabulator("#example-table", {
locale:"en-gb",
langs:{
"en-gb":{
"pagination":{
"page_size":"Page Size", //label for the page size select element
"first":"First", //text for the first page button
"first_title":"First Page", //tooltip text for the first page button
"last":"Last",
"last_title":"Last Page",
"prev":"Prev",
"prev_title":"Prev Page",
"next":"Next",
"next_title":"Next Page",
},
}
},
});
Button Position
If you simply want to change the position of the pagination element within the footer you can use CSS. The Styling Documentation contains a full list of classes used for styling the pagination elements.
To move the elements to the left hand side of the footer for example you would ned to use the following CSS:
.tabulator .table-footer{
text-align:left;
}
External Footer Element
if you want Tabulator to put the pagination elements into an element outside of the table, then you just need to pass the query selector for the element into the footerElement property in the table constructor. The Footer Layout Documentation contains full details on this.
In the example below i am assuming you have an element outside the table with an id of "my-footer" that you want the elements to appear in:
var table = new Tabulator("#example-table", {
footerElement:"#my-footer",
});
Here is the first part of the question:
$(".tabulator-paginator").find($(".tabulator-page[title='Next Page']")).text('>');
$(".tabulator-paginator").find($(".tabulator-page[title='Last Page']")).text('>>');
$(".tabulator-paginator").find($(".tabulator-page[title='First Page']")).text('<');
$(".tabulator-paginator").find($(".tabulator-page[title='Prev Page']")).text('<<');
As far as the second part tabulator have to keep the footer inside the table for it's javascript(the one the does pagination) to work. Hopefully in future updates it would let us do that, as it would provide more ability to custom the css.
We have developed a site with typo3 v8.7.11. We want to display the search box in the sidebar section, for this we installed the indexed_search extension. B
How to display a search box in all the frontend page sidebar section?
Edit:
The search and form action of the SearchController are both non-cacheable. This means that you would place a non-cacheable plugin on each of your pages, if you used my old answer. This harms performance and could have other side-effects.
Nowadays I usually simply include a search form on each of my pages by including this in my Fluid Template:
<form action="{f:uri.action(controller: 'Search', action: 'search', extensionName: 'indexedsearch', pluginName: 'Pi2', pageUid: searchPid)}" method="POST" role="search">
<input type="text" name="tx_indexedsearch_pi2[search][sword]" spellcheck="false" autocomplete="off" />
<button type="submit">Search</button>
</form>
I hand over the searchPid variable via TypoScript like this:
page.10.variables.searchPid = TEXT
page.10.variables.searchPid.value = <Pid where search results should be displayed>
Old answer:
My tip would be to create a TypoScript object that actually includes the plugin, like this:
lib.headerSearch = USER
lib.headerSearch {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
extensionName = IndexedSearch
pluginName = Pi2
vendorName = TYPO3\CMS
switchableControllerActions {
Search {
1 = form
2 = search
}
}
features {
requireCHashArgumentForActionArguments = 0
}
view < plugin.tx_indexedsearch.view
view.partialRootPaths.10 = Path/To/Partial/
view.templateRootPaths.10 = Path/To/Template/
settings =< plugin.tx_indexedsearch.settings
}
Then, in your template, include it like this
<f:cObject typoscriptObjectPath="lib.headerSearch" />
Note that you should create a new "Search.html" Template in Path/To/Template/Search/ for this TS-Plugin, so that it does not interfere with the regular plugin. Also, be careful if you include the search slot on the same page as the search Plugin itself.
you have multiple options:
copy the HTML of the form from the search plugin in the normal content and insert it in your page-(html-)template.
create a special BE-column, insert the search-plugin into this column and render this column inherited in all pages
make a special page not visible in FE, where you insert the search-plugin and include this special CE in the rendering of every page (use a CONTENT object in typoscript to select that special CE)
include and configure the plugin in typoscript. (see answer of Thomas Löffler)
I prefer option 2 as it is most flexible and does not need any special page or content IDs, which might change with time (option 3). It also can handle any kind of CE.
Option 1 needs manual fixing if there are changes in the plugin rendering after an update for example.
Option 4 is not possible for each plugin or CEs at all to inherit. If you can configure the plugin with typoscript it is a fine option because you do not need any record (from tt_content)
for option 2:
temp.inheritedContent = CONTENT
temp.inheritedContent {
table = tt_content
select.orderBy = sorting
// -- use your own column id: --
select.where = colPos = 100
select.languageField = sys_language_uid
slide = -1
}
Use a TYPO3 extension, which can be a copy (fork) of the newly developed version of macina_searchbox
Template Module: Add "Macina Searchbox" under "include static from extensions" .
Use this or a similar TypoScript to include it, where '6' in this example is the search page. Use your own page id instead.
Constants:
lib.macina_searchbox {
pidSearchpage = 6
}
Setup:
10 = TEMPLATE
10.template = FILE
10.template.file = fileadmin/template/template.html
10.workOnSubpart = DOKUMENT
10.marks {
SUCHE < lib.macina_searchbox
LOGO = TEXT
LOGO.value = <img src="fileadmin/template/img/logo.png">
NAVI= HMENU
NAVI {
Then you can edit the Fluid template files in the folders below macina_searchbox/Resources/Private/ to modify the output of the searchbox. This method is necessary in order that the search result list will not be shown on the page. You must instead insert an Indexed Search plugin on your search page, which has id=6 in this example. SUCHE is the marker in the main template of the website. Use your own marker.
The easiest way is to copy the given plugin from indexed_search to a variable you use in your template.
When you e.g. use FLUIDTEMPLATE:
page.10 = FLUIDTEMPLATE
page.10.variable.searchBox < plugin.tx_indexedsearch
After that you can assign a separate template and make other modifications by changing page.10.variable.searchBox with the possible configuration here: https://docs.typo3.org/typo3cms/extensions/indexed_search/8.7/Configuration/Index.html
How can I get the label of the link that is clicked by the user?
I have tried:
var elem=document.getElementById("#{id:link1}");var lbl=elem.label;
But this is not returning the label name.
The "label" property of a Link control is called text so the following server-side Javascript will get you the value of the label of the link and store the value in the variable "label":
var linkControl = getComponent("linkExample");
var label = linkControl.getText();
In Xpages [xp:label] tags turn into [span] tags so on csjs you have to use the innerHTML to get the value so your original code would have worked had it been.
var elem=document.getElementById("#{id:link1}");
var lbl=elem.innerHTML;
I need to know how to insert a list item with a hyperlink field using the oob web services.
I already have the code to do the insert, just not sure about the hyperlink.
Here is a standard text field (just part of the code):
+ #"<Field Name=""Annotation"">" + this.messageEnvelope.DM.Annotation + "</Field>"
Now how can I insert a hyperlink , there is absolutely no documentation on this. Thanks in advance
SharePoint stores its links in this format (note the comma and space between the URL and the description):
url, description
http://example.com, An Example
I'm not sure about the web service, but it should work just the same.
From code, you can use the SPFieldUrlValue class to format this value:
SPFieldUrlValue urlVal = new SPFieldUrlValue();
urlVal.Url = "http://example.com";
urlVal.Description = "An Example";
string spUrlFormat = urlVal.ToString();