intellij auto completes a tag without href - intellij-idea

I know that when doing
a TAB it used to auto complete to this is no longer the case for me. It simply does this: <a></a> Is there a way to turn this back on? in html and php files

You can create create Live Template from Preferences > Editor > Live Templates to associate a TAB with .
Here's an example:
In this example the text has been associated with Abbreviation: a and has been configured to Expand with Tab.

Related

Display module fields in Sitefinity using conditions in the back end

I'm looking for a way to show module fields conditionally on the back end screen of Sitefinty.
For example, say I've created a module through module builder - and I have two fields: a checkbox and a text field.
I'd like the text field only to display to content editors only after they've checked the checkbox field. Ideally that checkbox could hide/show a handful of fields on the spot through the content entering process.
Is there a straightforward, maintainable way to go about this?
Currently using version 10.2, it'd be great to know how to accomplish
this via both the new and old UI.
Hoping there is an advanced setting I just don't know about, but
willing to go a JS approach as well.
Thanks!
After a little digging I've been able to find a working solution. Here's how I handled it:
Note: [module] and [section] assume your custom module name and section. If you didn't setup sections in backend screens and tweaks then all of the fields will be under MainSection
Step 1 - Add a custom script to the module in advanced settings.
Assuming this is a dynamic module...
Create a JS file in your project and reference it in advanced settings by going to:
Advanced settings > Dynamic Modules > Controls > [module] > Views > [Module]View > Scripts
Click Create New and point the script location to the JS file you created.
Step 2 - Add custom classes to your fields
Stay where you're at in advanced settings and navigate to the fields you've made. For example:
Advanced settings > Dynamic Modules > Controls > [module] > Sections > [Section] > Fields > [Field]
On this page scroll down to CSS Class and add a custom CSS class to this field
Step 3 - Add your custom Javascript
Sitefinity uses jQuery so I worked with that and set up some really basic JS based off the class names:
$(document).ready(function(){
$('.myTextBox').hide();
$('.myCheckbox input').on('change', function(){
var $this = $(this),
textBox = $('.myTextBox');
$this.is(':checked') ? textBox.show() : textBox.hide();
})
});
Note: the custom CSS class gets applied to the parent wrapper of the actual element
Now when a content editor goes to add a new content item to a module, checking that specific checkbox will show and hide the custom text box.
Besides the fact that this process seems a little over the top, there are a few other issues:
You have to set the call to your custom script on the edit and insert
view.
It doesn't take into account any validation.
With Sitefinity getting a backend UI upgrade, long term sustainability is questionable.
I'll leave this question unanswered for a while if there is a better/easier approach to this.

how to add tab to preference page as part of plugin development

I have created a plugin showing in preference page of eclipse (using plugin develepment env of eclipse). I want to add tabs to this page but not able to find how to do so.
i want tabs as circled in image
These tabs are just ordinary TabFolder (or CTabFolder) tabs. There is no special support for this in preference pages you just code the TabFolder and TabItems in the createContents method of the preference page.
Your example page is created by org.eclipse.compare.internal.ComparePreferencePage, you could look at the source of that.

How can I add a menu of local Trac projects to templates/site.html?

I have multiple Trac projects with different environments on the same server. I would like to have a list of links to all projects at the top of each project page so I can quickly switch between them with out having to go up to the top level list at /projects/.
The ideal solution would:
not require loading all the Trac environments on every page load.
update automatically when a new project is added.
only require editing the config and/or templates or add a plugin.
work for Trac 0.11.
The NavAddPluggin allows the main trac navigation bar to be customized. You could add menu options for each trac of your projects. To add a new menu item the following is added to the trac.ini file.
[navadd]
add_items = project1
project1.target = mainnav
project1.title = Project One
project1.url = http://webserver/trac_project_1
To sort the order edit the mainnav option in the trac.ini
mainnav = project1,wiki,timeline,roadmap,browser,tickets,newticket,search
To answer the question of how to add a meny using site.html, here is a very basic top header to get you started - paste into the site.html placeholder:
<!--! A top header -->
<py:match path="body" once="True">
<body py:attrs="select('#*')">
<div id="top">
<a py:if="req.href() != '/one'" href="/one">one</a>
<a py:if="req.href() != '/two'" href="/two">two</a>
<a py:if="req.href() != '/three'" href="/three">three</a>
</div>
${select('*|comment()|text()')}
</body>
</py:match>
The example uses very simple logic and just hides the current project . You may want to do it differently, typically using highlighting or similar.
See Trac Layout Recipe for an advanced example. This is the layout in use at edgewall.org to switch between the various projects (Trac, Genshi, Babel, Bitten).
The method described by sudo_o is probably your best bet. It will give you something that is very well integrated into the Trac interface.
However, I wanted to mention a quick-n-dirty alternative that you may find useful. You can configure the logo in the upper-left corner of every Trac page to link to a specific page when clicked. Many Trac installations use this to link back to the start page. The link is configurable, however, and you can make it point to your project listing page. In your trac.ini file:
[header_logo]
src = site/your_logo.png
link = /url/to/projects/page
alt = Click to load projects listing
This method gives you easy access to your projects listing, and doesn't require adding any extra entries to your Trac menus. When you add or remove projects, you don't have to modify every trac.ini file to update the links. The downsides are that it takes an extra click to get to another project and that some users might not find this method as intuitive (setting the alt property helps with this a little).

Mapping a widget template to a user control in SiteFinity 5

(Crossposted in SiteFinity's forums)
I'm using SiteFinity 5.0. I created a custom module, using the module builder, called Promos. It's content type is called Promo.
Next, I created a new widget template called PromoFlexSpace. I basically copied the auto-generated template for a single Promo display and changed it a bit.
What I would like to do is globally map this widget template to a user control, so that any time that template is selected, it actually uses my user control. I've found how to do this for an individual item:
http://www.sitefinity.com/documentation/documentationarticles/designer-s-guide/widget-templates/using-external-widget-template-file
http://www.sitefinity.com/blogs/joshmorales/posts/11-05-10/mapping_external_templates_for_sitefinity_4_widgets.aspx
And I found something that came close to explaining what I'm trying to do on a global level:
http://www.sitefinity.com/blogs/joshmorales/posts/11-07-26/customizing_sitefinity_4_controls_with_the_viewmap.aspx
But I haven't found a way to accomplish what I'm trying to do yet (apologies if that last link actually does explain it - I need a better breakdown if it does).
What I've tried so far is going into the advanced settings > controls > view map and adding an entry there, but I can't find a value for HostType that works.
If you go to Administration > Settings > Advanced > Toolboxes > ... > [Your Widget Control] there's a setting for "LayoutTemplate" where you can enter a path to an .ascx file.

How to change the url of my entire page when a new tab is selected? (Dojo-Tabcontainer)

I have used Dojo-Tabcontainer to create tabs. I want to have a separate template for every tab. So, when a tab is clicked I want a new page to be loaded and the url to be changed.
Can you please suggest a way to do this using Markup instead of programmatic way?
I'm thinking of using Template Inheritance while creating html page for each tab to avoid redundancy.
I can get some clue from this:
How to change Dojo TabContainer behaviour to simply open an external link instead of showing a ContentPane?
But I'm not sure how to do it via Markup instead of programming.