joomla loadposition - how to set module position? - html

I have a custom module (custom HTML) that I want to be on a specific Article
I am using the {loadposition modulename} and it displays my custom HTML modules. However I cannot seem to find where to change how my module is displayed - I want to place it in a specific location on my article, but where do I put in the position information for this?

To accomplish this the {loadposition item} must be contained within a div that has css style attached
I accomplished this by doing the following:
In the article switch the editor to show the HTML code
add the {loadposition} as follows:
<div class="wrap">{loadposition cp_frontpage}</div>
I then add a css file that handles my wrap div
.wrap
{
text-align:center;
margin-left: 0px;
margin-right: auto;
width: 50%;
height: 50%;
}
this can be done as an inline css, or by an external css file (as I did above)

If you want to place the custom module in a specific location of your article page. Please follow the below steps:
The first thing you will need to do is create the module..
Login to the administrator panel of your Joomla installation
Navigate to Extensions -> Module Manager -> New and select the module you wish placed in to your article (eg. Custom HTML)
Set the module postion to one that does not exist in your template. To achieve this, click on the dropdown box next to the 'Position' option and simply type in a new, distinct, module position (eg articlemodule_footer. I like to give the modules a common prefix (eg articlemodule_). This allows me to easily search for my article modules at a later date.
Set the 'Menu Assignment' to 'All'. (Note: it will only appear on the pages with your article because it is the only place where the articlemodule_footer module position is called)
Setup the rest the remaining parameters for your module and click the 'Save'.
Once you have set up your module it is now time to place it inside the article(s) you wish it to appear. For this the Joomla! team has provided us with the loadposition function.
Open up the article(s) in which you wish to place your module and navigate to the area of the article with in your editor where you want the mopdule to appear and type the following...
{loadposition position}
Replacing 'position' with the position name you assigned to the module which you have just created. Eg..
{loadposition articlemodule_footer}
Click save and your done!
If you find that the module is not showing in your article be sure to check the following...
Navigate to Extensions -> Plugin Manager and ensure that the 'Content - Load Module' plugin is enabled.
Clear your site's cache and refresh the page. (Joomla Administration -> System -> Clear Cache)
For us to be able to display this function in this tutorial we had to place the curly brackets surrounding the function in italics. Ensure the italic styling was not copied across if you have copied the function directly from this article.

Related

Sublime text 2 Snippets - autocomplete

I've created a bunch of snippets in Sublime Text 2, but I cant remember them all off the top of my head. I've seen in a number of tutorials that as people start typing their snippets tab-triggers it will start to provide a list of the matching snippets. I don't see this.
Is there a setting somewhere for this? Or do I need to create a special file (completions file?). For most snippets I have the <scope> commented out as I may use in a PHP or HTML file for example depending what I am working on.
Most of my snippets tab triggers start the same elq- prefix, so it would be very helpful if it were to start showing me the options as I type.
The setting auto_complete_selector controls when Sublime automatically offers the popup for possible completions. The default value for this setting is:
// Controls what scopes auto complete will be triggered in
"auto_complete_selector": "source - comment",
This means that it will automatically pop up for any file that's considered a source code file, except within a comment.
The scopes for the file types that you mention in your question are text scopes and not source scopes, which stops the popup from appearing.
One way around that would be to manually invoke the auto complete panel by using the appropriate key binding, which by default is Alt+/ on Linux or Ctrl+Space on Windows/OSX. When you do that, the popup for possible completions at this point is manually displayed.
To allow this to work more automatically, you would need to modify the setting for auto_complete_selector to be more appropriate for your situation.
To do that you could select Preferences > Settings - User from the menu and add or modify the auto_complete_selector setting as follows:
"auto_complete_selector": "source - comment, text.html",
This says that the selector should always be displayed in source files except inside comments (like the default) and also within HTML files.
You could also use text instead of text.html if you want it to work in all text files of all types, although this would possibly get quite annoying while working with plain text files. Substitute an appropriate scope or set of scopes here as appropriate to dial in the places you want this to be automatically offered.

Add div element if class is present

Wanting to add a div element if a class is present on the page.
This is for IPS forum software. Reached out to them about this and their response was that they would charge for a custom theme design. Would rather do this myself if possible (bit too expensive otherwise).
I want to display a specific div for the "compose new private message" modal popup without displaying it on all other modal popups. Can't use body page controllers so I'm guessing my only option, other than having the PM modal inherit from a new template, would be to try and display a div if a certain class exists.
Templates are stored in the database for IPB. You can utilize the Admin system to go in and edit the templates. There is an extensive series of menus that give you access to individual template code, for example, under Messenger, there is sendNewPersonalTopicForm, PMQuickForm, and sendReplyForm.
It should be relatively easy to go into those templates, find the markup you want and add a container div where appropriate.
For example, for a 3.x board, you find something like this:
<div id='message_compose' class='post_form'>
<form id='msgForm' style='display:block'
action="{parse url="module=messaging&section=send&do=send" base="publicWithApp"}" method="post" enctype='multipart/form-data'>
This seems fairly simple code to alter.
I would recommend a Plugin with a theme hook. You can put your logic in the php file and assign your hook to show up exactly where you want it.

Changing code autocomplete in WebStorm

WebStorm have specific JSX code autocomplete for React.js. It goes like this:
div. + Tab => <div className=""></div>
But I'm using SCSS, so I need to change autocomplete from className to styleName:
div. + Tab => <div styleName=""></div>
You can override this default behavior by creating what Jetbrains calls a "Live Template" (this feature exists in other Jetbrains products as well).
First navigate to the Webstorm Preferences. On the left you'll see a tree structure showing the preferences listed by category. Expand "Editor" to find "Live Templates".
Once you select Live Templates you're presented with a tree structure on the right that displays the Live Templates currently enabled.
On the far right side of this table you'll find a small + button which allows you to create your own Live Template.
After you select + -> Live Template you'll need to fill in the Abbreviation, Description, and Template text at the bottom.
The Abbreviation is the characters that you type in to activate this template. In this case enter div.
The Description field can be whatever you'd like to describe this template, it has no functional impact.
The Template text section is the replacement text. In this case I would use
<div styleName="$END$"></div>
Note that $END$ is a variable that puts the cursor in that spot after the live template is activated.
Lastly you need to specify which file types the Live Template should work against. Notice the phrase "No application contexts yet. Define" at the bottom of the page. Click on the word Define, in the popup menu that appears expand Javascript to find the option for JSX HTML and check it. If you'd like the Live Template to work in other cases feel free to select additional file types.

Headings created inside of a template

I have a number of templates that create headings based on a formula. I am wondering if there is anyway to create an "edit" link that will take you directly to that section? The way that it currently works, the edit link takes you to editing the template itself. Could I possibly create a customized link that would keep you on the page and take you to right part?
Here is some sample code to help clear things up...
Template:Head:
==={{{1}}}===
This is a heading titled "{{{1}}}"
Test Page:
=Section 1=
{{head|1.1}}
{{head|1.2}}
{{head|1.3}}
=Section 2=
{{head|2.1}}
{{head|2.2}}
{{head|2.3}}
At the moment, if I want to edit the information for template "2.3", I have to edit all of section 2. (Note that for this example, that isn't a big deal. For the actual templates I am working with on my site, the templates have dozens of parameters and there are sometimes 10 or more in a section.)
Bottom line, is there way to create a custom edit link inside of the {{head}} template that would take you directly to editing the templates call on the page "Test Page"? Hope that makes sense.
Edit: Is there perhaps a way to make use of "anchor" tags? Can anchors be passed in to the URL?
To restate your problem, when you transclude a section heading the header isn't treated as being part of the destination page, so the edit link takes you back to the source. So you need a separate container for the template in order to edit it individually, and a complete section is the smallest editable container.
The only way I can think of doing this is using subpages (or virtual subpages if you don't have that ennabled in this namespace, doesn't change anything). So instead of placing {{head|1.1}} on MyPage, put it on MyPage/Subpage1 and then transclude that into MyPage in the usual way ({{:MyPage/Subpage1}}).
{{head}} can then include a custom edit link to the template input by using HTML heading tags (<h2> is equal to ==, etc.) to suppress the standard edit link and then use one of these templates (probably {{ed right}}) to create a custom edit link pointing to MyPage/Subpage1.
The way to create anchors in Mediawiki, by the way, is to use a <span id="name"/> tag, but that doesn't create a container that can be edited (or at least, not that I've been able to work out through URL tinkering).
I'm pretty sure there's no way to do that. As far as MediaWiki's section editing feature is concerned, the only thing that begins a new section is a line of the form:
=== Some text here ===
with the number of = signs determining the level of the heading. There's no way to get MediaWiki to let you edit any segment of the document that doesn't begin and end with such a line (or the beginning or end of the page).
Well, OK, I'm sure you technically could do it with an extension, in the sense that you can do anything with a MediaWiki extension. All you'd need to do is provide some way (e.g. a special parameter in an edit URL) for to user to indicate "I want to edit this template", then extract the template from the wikitext, present it to the user for editing, and write the result back into the page text over the original.
The tricky part will be extracting the template from the page source. (Finding and replacing templates on a page is a fairly common task for MediaWiki bot writers, so you might want to look for ideas there.) Whatever method you end up using for that, there will probably be edge cases where you need to give up and tell the user "Sorry, but I can't figure out how that template is transcluded here."

Where are these HTML elements created in the Joomla code?

I'm working on a site for a client, and I've never used Joomla before. I keep seeing elements in the HTML, that I can't find in the code. It's Joomla with Virtuemart and the bt_bazaar template.
For example, at the top of the page there's a div with the class bt_toolbar. When I search the entire public root of the site, it only turns up a match inside CSS, and this line from bt_bazaar/helpers/bt_helpers.php:
$this->bt_toolbar = '<jdoc:include type="modules" name="toolbar" style="BTxhtml" />';
Where is this toolbar? How do I find other module types in the code? Where is the class name bt_toolbar set?
Thanks,
Frankie
Its a Joomla Module.
You can find the joomla modules under
public_html/modules/mod_modulename.
here your module name is toolbar but this name may not be the module name (we can have option to use other names and same name).This name stands the position of the module.
go to admin side and in the module manager you can find a module name with toolbar position name.
eg: mod_somename.
Then go to front end modules/mod_somename/tmpl/default.php
This is the HTML out put of the module.
If you not found the same module on the above path or you changed the file not effecting it.
It may be overrided.
Then you can find the module at
public_html/templates/your_tmplate_name/html/mod_somename
it depends upon joomla version too.
Hope This will help you...
BTxhtml looks like module chrome so look in the modules.php file of your template and see if it is there.
Also name= tells you the name of the position the module is assigned to, so if you go to the module manager and filter on position toolbar you should find it.