How to add a search module as a menu item in Joomla? - html

My simple setup:
<div id="menuwrap">
<div id="menu">
<jdoc:include type="modules" name="menu" styles="" />
</div>
</div>
And
ul.menu {
display: inline-block;
}
because i need it to be centered.
This is displayed as follows (imagine it is centered on the screen):
Menu_Item_1 | Menu_Item_1 | Menu_Item_3
I would like to add a search box (a standard Joomla search module) as a menu item. That is:
Menu_Item_1 | Menu_Item_1 | Menu_Item_3 | Search...
I've tried to put the search module into another div, inside #menuwrap and float #menu to the left and #search to the right.
Menu_Item_1 | Menu_Item_1 | Menu_Item_3 | Search...
This is OK until resizing:
Menu_Item_1 | Menu_Item_1 |
Menu_Item_3 |
Search...
The #search just gets pushed under the #menu (on the third line - this is because the display of the ul is inline-block). The goal is to remain on the same line as the menu (i.e., second line), as follows:
Menu_Item_1 | Menu_Item_1 |
Menu_Item_3 | Search...
Any suggestions? Thanks.

If I'm understanding you correctly - you want to embed the search module itself within a menu - rather than linking to it from a menu item.
I think there are a number of ways to do this:
The easiest way is to fake it. Put a background on the div that contains your module position - publish two modules to that position (the menu and the search module) use css to make sure they float alongside each other.
Alternatively if you really need to embed the form within the same module I'd suggest creating a 'custom module chrome' to add the html of the search form to the output of any module you publish within a position that uses your custom module chrome style
Here is an article covering the basics - probably for an older version of Joomla - but as far as I can tell the principle holds:
http://docs.joomla.org/Applying_custom_module_chrome

If your goal is to add the search module as a menu item, then you need to make of it a component using this extension:
http://extensions.joomla.org/extensions/core-enhancements/embed-a-include/3810
You just need to place the module in a custom (probably hidden or nonexistent in a template) position and then you create a menuitem that points to the m2c component and use that position there.

Related

How to create custom HTML Elementor wrapper section?

I have created several sections with plain HTML and CSS that I would like to use as "wrapper" sections for my clients to be able to populate using Elementor drag and drop interface. I have tried to do this creating a custom Elementor widget, but there is no "Controls_Manager::NAME_OF_CONTROL" that I could find that would correspond to an Elementor section or inner section. (Controls_Manager::WYSIWYG is actually just a text editor).
I've also tried creating an elementor section template that has two HTML blocks: one above and one below an empty elementor section. Like this:
---------- begin HTML (Elementor or Wordpress type) block ----------
<div class="myOpeningSectionDiv"> <!-- no, it's not just a single div, I'm using opening div as an example here for brevity -->
---------- end first HTML block ----------
---------- standard empty Elementor block with the little + button goes here ----------
---------- begin second HTML (Elementor or Wordpress type) block ----------
</div>
---------- end second HTML block ----------
This does not work, because Elementor wraps those custom HTML blocks in its own html tags which breaks things.
The closest I solution I could find is creating two templates. One template is the contents simple Elementor drag and drop contents that the client can edit. The second contains just one custom HTML block with a short-code pointing towards the first template. The client would then insert that into their page. This is not ideal because 1) When you preview the page, the contents of the shortcoded section do not show up, and 2) they have to edit that section separately from the rest of the page in the templates area and can't create other sections like it without messing with HTML directly or getting me involved.
I've been searching the internet for two days for a solution and came up short. Is this possible to do?
And no, I don't think I can use a theme page template, because I need them to be able to drag and drop other sections with elementor above and below this section.
To summorize I'm trying to do this:
[Some elemnentor drag and drop content]
<someCustomReusableHtmlIWroteHere>
[Section where you can drag and drop buttons, text, form, etc using Elementor]
</someCustomReusableHtmlIWroteHere>
[Some more elemnentor drag and drop content]
I hope I'm explaining this correctly. As far as software used: latest Wordpress and Elementor Pro.
Use Elementor PHP Hooks for this:
For example:
add_action( 'elementor/frontend/section/before_render', function ( \Elementor\Element_Base $element ) {
if('section' === $element->get_name()){
// your code here
}
} );
add_action( 'elementor/frontend/section/after_render', function ( \Elementor\Element_Base $element ) {
if('section' === $element->get_name()){
// your code here
}
} );
The only issue is that while this works on the actual rendered page,it doesn't show the extra HTML in the preview in Elementor. This seems to be an issue with the before_render and after_render hooks.
you can use Unlimited Elements for Elementor,
this plugin has functionality to create own widget with html, css and JS.
then you can re-use that widget anywhere on website.
https://wordpress.org/plugins/unlimited-elements-for-elementor/

Mediawiki - Display text inside a link

I have this link:
[[user1 | Foo:555-5555]]
[[user2 | Bar:555-5556]]
On each user page I have:
===UserName===
==PhoneNumber==
I want to make the link become automatic, something like this:
[[user1 | UserName:PhoneNumber]]
Is it possible?
I could not find a wiki entrance query, but using Semantic from MediaWiki as sugested by Tgr, it did the trick.

How to use html radio button label with Angularjs

I was trying to display a list in html as label for radio button which should look like this:
| option1 |
| option2 |
The option number is not fixed,in my back-end, I use AngularJs to make the website dynamic.
My code looks like this:
{{opt}}
Now the result I have looks like this:
| option1 |
| option2 |
I know it is because I only create a but don't know how to fix it, could anyone give me some suggestions?
From my understanding of your question you are trying to get your label buttons to look like list items?
If so use this CSS to get the container of your radio boxes to look like list items:
.label {
display: list-item;
}
Also I would like to point out that Angular JS is NOT a back-end framework.
AngularJS is a structural (front end) framework for dynamic web apps. It lets you use HTML as your template language and lets you extend HTML's syntax to express your application's components clearly and succinctly.
(Source)
You can read more about what Angular JS is over here.
You can also read more about Angular's Api over here.
Good luck and all the best.

Prevent search engines from scanning preview of other pages

I've got a website. After every article there is a big (7 sentences) preview for another article.
The problem is that google index this preview, and it makes my content duplicate.
How can I tell google not to read those previews?
One effective though less-than-ideal solution could be to load the random article preview with Javascript. It's similar to how some blogs have a "click to load comments" button - they don't want their blog being associated in Google searches with everything their commenters say.
Since you're keeping the primary content of each page the same, I don't think this would be a cloaking issue, but no guarantees.
You can do this by putting the preview section in a different span that would be hidden by Css properties and displayed using javascript at the time of page loading.Since the section is initially not displayed thus it would not be read by the search engine.
Dummy Html code
<span class="pgPreview">The preview for the next pages goes here </span>
Css code to hide it
.pgPreview {
display:none;
}
Javascript code to show it.
<script type="text/javascript">
$(document).ready(function()
{
$(".pgPreview").show();
}
</script>
Assuming that you have the jquery library included.
Reference
I know there used to be a system of labels such as:
<!-- googleon/googleoff: <index|anchor|link|all> -->
...but I do not know if that still works on these days...
also, I think it was only valid if you were using google custom search.
(do not really know for sure)
In any case, I can think in two ways to do what you need:
A) Hide content in iframes
B) Generate a text-image with that preview text
lolum dolimus
situs amen amdu etr --> normal content
nulusan ar sindh ew
_____________________
| lolum dolimus |
| situs amen amdu etr | --> iframe blocked with
| nulusan ar sindh ew | robots.txt file
---------------------
_____________________
| lolum dolimus | image with text
| situs amen amdu etr | --> unreadable to
| nulusan ar sindh ew | search engines
---------------------
Of course, both options are not completely infallible and depends solely on whether the search engine follow the directives in standardization and/or the ability to have OCR recognition.

Is it possible to let few page have the same customized TOC in dokuwiki?

I'd like to make the database of famous musicians using dokuwiki.
Musician has their own Biography, Discography, Members, and Live Concert Info.
For example, Aero Smith. They have many CD released. and historical events.
So does Live Concert Info.
That's why basically I'd like to make all the page separated something like this.
Aero Smith (Main Page of Aero Smith)
Biography
Discograhy
Members
Live Concert Info
I was talking about only Aero Smith. But there will be other famous musicians, too just like this.
Red Hot Chilli Peppers (Main Page of Red Hot Chilli Peppers)
Biography
Discograhy
Members
Live Concert Info
So each band should have 5 pages for total including Main Page.
Then here's my question.
Is it possible to let these 5 pages have the same menu which has links to other pages?
For example, I want the Table of Contents(or Side Menu) which has link to these
Main Page(of Aero Smith)
Biography(of Aero Smith)
Discograhy(of Aero Smith)
Members(of Aero Smith)
Live Concert Info(of Aero Smith)
Of course, this will be shown only in Aero Smith's content page.
In other musician's page, their menu will be shown up just like "Main Page(of Red Hot Chilli Peppers)"
and one more thing. I want this "Table of Contents(or Side Menu)" just as menu for links to the other pages.
I don't need the same name header in a page. All I want it is only for the links to the other pages.
I just want it as menu that indicates links.
Are they possible with dokuwiki? or Is there any other wiki that can make all of these possible?
HUSTEN, you can certainly do this following the guidelines for creating Namespace Templates and placing 'relative' links in the template in order to link to the sub-pages. (See the 'aside' below in regard to namespace/page naming.)
Place the following markup into your page named: bands:aerosmith:main
Menu: [[.:main | Main Page]] [[.:discography | Discography]] [[.:members | Members]] [[.:live | Live Concerts]]
Note the use of .: in the links to create 'relative' links to the current namespace. See DokuWiki Namespaces
You may also want to add any common headings or sections into this page as well as the menu links (as this will be your template).
Now follow the instructions on the Namespace Templates page to copy /bands/aerosmith/main.txt to /bands/__template.txt (note the double underscores which will make the template apply to all sub-namespaces within the 'bands' namespace).
Now, whenever you create another band page, such as bands:red-hot-chilli-peppers:main, it will automatically be populated with this menu of links to the other pages (and you have the benefit of just clicking the link in order to create the page).
A brief 'aside' in regards to DokuWiki pages and namespaces:
If you create a new 'page' named bands:aerosmith
then you end up with a Namespace named 'bands' which contains a Page named 'aerosmith.txt'
But if you create a new 'page' named (note the trailing colon) bands:aerosmith:
then you end up with a Namespace named 'bands' containing another Namespace named 'aerosmith' which contains a Page named 'start.txt' (if you haven't changed the default page name in the configmanager).
So, if you use my instructions above, you will end up with a Namespace named 'bands' and a Namespace named 'aerosmith' and a Page named 'main.txt'. BUT you do not have a page named 'start.txt' so if you attempt to browse to /bands/aerosmith then you won't see the 'main' page as it will (by default) attempt to show you the 'start' page in that namespace.