How To Include Breadcrumb Module On A Component for Joomla 1.6 - module

I have a custom component that requires the standard Joomla breadcrumb module. I tried using the following and it didn't do anything:
<jdoc:include type="modules" name="position-2" />
Keep in mind this code came from the template index file and I am trying to integrate the module into a custom component

That is not how to do it. This is for use in Joomla templates to include the module position. You need to make the breadcrumbs programmatically from within your component. See this tutorial on how to do this: http://docs.joomla.org/How_to_add_breadcrumbs
NB: Once you have done this ensure that you have the breadcrumbs module published and the position is set correctly for your specific template.
This link will also be useful - http://docs.joomla.org/JPathway/1.6
[EDIT]
Try add this in your view.html.php for your component:
$app = JFactory::getApplication();
$pathway = $app->getPathway();
$pathway->addItem('Google', 'http://www.google.com');
This will add a breadcrumb that says "Google" and when clicked will link to www.google.com
In terms of creating your breadcrumbs you need to use your url to determine how far you are into you component e.g. "Home // Category // Weblinks" would have a url like:
http://www.domain.com/index.php?option=com_weblinks&cid=2:dogs&id=54:link-to-google
cid = 2 tells us that we are at least in the category, so we can add a breadcrumb for this.
id = 54 tells us we are looking at a weblink so we can add a breadcrumb for the page before which is the list of weblinks within the category

Related

Additional custom page building hook for BuddyPress profile page

I want to create an additional page like in the picture below and I want to show the codes I want in the page, I researched but I couldn't get a result. What is the hook name I can do this?
https://prnt.sc/wccy4e
This gist shows how to add a simple nav tab + subnav.
If you want to load specific templates ( perhaps from a plugin ) into a custom nav screen, you need to use bp_register_template_stack, and the code becomes more complicated.
This is an example for adding a custom tab to groups and loading templates via bp_register_template_stack.

How to link to a custom template in Shopify?

I'm trying to add a link to a button in Shopify, but I can't get it to work.
I created a new template file in Templates called "page.alternate.liquid"
Then I try to link to it from header using this:
LINK
The output doesn't add any link at all, just a regular text.
To view an alternate template, you have two options:
1) On the resource in question, choose the template that the resource should default to using the selector on the right-hand side.
(Note: this only shows if you have at least 1 appropriate alternate theme in the live theme, and will only list the alternate templates in the currently-live theme)
2) When linking to the resource, add view=<template-suffix> to the querystring of the link.
Example: To link to an alternate page template templates/page.inverted_colours.liquid, your link URL would be /pages/about-us?view=inverted_colours
In your case in the question, that would look something like LINK
This article on Shopify partners blog might help as well: https://www.shopify.ca/partners/blog/shopify-alternate-templates
Hope this helps!

How can I use vue.js and wordpress rest api to template a specific page?

Does anyone know how to expand this theme ( https://github.com/gilbitron/wp-rest-theme ) in order to theme specific pages? For example, I would like to create a page called "Menu" which has a unique navigation to click through to child pages Breakfast, Lunch, Dinner, etc without reload. I'm used to creating individual .php files to theme specific pages to my liking via page-{slug}.php - Is there an equivalent workflow using vue.js and wp rest api?
Instead of using page-menu.php to customize the /menu page, I would imagine I'd need to create something like a menu-page.vue file and add a custom method to specifically call that page in order to template it.
I can't find any examples of this process. Any help would be greatly appreciated.
What I did was add a field using Advanced Custom Fields that determined which template the page should use. I wrapped the display in a component called PageContent that looks like this:
<div :is="page.template"
:page="page"
v-if="!$loadingRouteData"
transition="fade"
transition-mode="out-in">
</div>
router:
'/:slug': {
component: PageContent,
name: 'Page'
}
So when someone navigates to that route, I fetch the page based on the slug param. The page variable then has a template attribute through ACF, which determines the component to display and defaults to a generic page:
if(pages[0].acf.template){
return pages[0].acf.template;
}
return 'page'
You need the WP JSON API plugin as well as the ACF plugin that adds ACF data to the json
My site uses this setup, happy to share more code if you have more questions.

Orchard - Displaying widget on a custom module's page

I am developing a custom module for Orchard. I would like to use a Widget on one of my pages in my custom module.
How can I add the widget to a page (display it as a partial view? how to reference it?)?
The goal is to create a home page as a module, when you activate it, it would have all the features with Item Slider Widget - http://gallery.orchardproject.net/List/Modules/Orchard.Module.FeaturedItemSlider. So the widget would be in content part of the page.
Thank you
You can do this in two ways:
In the module management in the administration add new layer rule. You can specify the url rule with this syntax - url("~/myurl") or url("~/myotherurl") or ... where you can specify multiple urls where the module will be shown. Next, you can add your widget to that layer. This is OK if you need to show that widget in a small amount of pages.
You can add a new Zone inside your theme (lets say it will be called MyWidgetZone). Don't display this zone in your Layout.cshtml, but rather in the template where you would want to use it (for example in your Content-Page.cshtml file). To show this zone, you would use this syntax inside your template - Display(Layout.MyWidgetZone). All you have to do next is add your widget to MyWidgetZone inside module management administration and you're good to go..

How can I display Joomla modules within a component?

I have a component with several categories of games and I want to display a different banner depending on the category. I need the banner (and link) to be customizable so it's not simply a case of showing categoryX.jpg or whatever.
I saw this Joomla help page on another question, but it only seems to display a module type, not one specific module. I'd like to use various mod_custom modules and display the one appropriate to the category (I can store each module's ID if necessary).
Any ideas?
This can be done in a 2 step process:
Use the "Load module into article" plugin to allow yourself to access the module using a plugin call like:
{module [*mod_id*]} // where *mod_id* is the module id
Now that you can call a plugin to put your module anywhere, you now need to go to the view code of your/a component you wish to add the module to and add this code:
echo JHTML::_('content.prepare', '{module [*mod_id*]}');
Please see this link - http://www.alltogetherasawhole.org/group/developers/forum/topics/running-joomla-content-plugins - regarding point number 2. I was trying to do the same thing and I found it didn't work, and the reason for this was a comment you can find on the page link above:
"I noticed that some plugin actually expect option=com_content for them to process onPrepareContent properly, so you might actually want to "fool" them by callin JRequet::setVar and restoring the correct values after the trigger."
If you would like to show module within PHP code then use this code, it's worked for me :
<?php echo JHTML::_('content.prepare', '{loadposition position-2}'); ?>
If you want to show module inside html content then just put this code where you want to show module.
{loadposition position-2}
It loads all modules which are assigned to position-2.
You can also use the Joomla Module Renderer
$doc = JFactory::getDocument();
$renderer = $doc->loadRenderer('modules');
$position = 'custom_position_name';
$options = array('style' => 'raw');
echo $renderer->render($position, $options, null);
Just a heads up, Along with being assigned the module position, that module also has to be set to "Display on All pages".
Joomla has this functionality built in. You can use the {loadposition XX} command within your content items. You can specify custom module positions that do not appear in your template to insure that you have the correct module in the correct article.
http://docs.joomla.org/How_do_you_put_a_module_inside_an_article%3F
You could create a new module?
If each category appears in the querystring (catid=X) then you could take a similar approach to https://support.pillwax.com/open-source/doku.php?id=joomla:header_image.
Alternatively, that link might actually do it for you.