Is there any way to change Sitecore Rocks Sub layout template structure (VS 2013)? - sitecore

When I create new item -> sub layout it will create web user control. I need change the template structure of web user control's code behind file (using should come outside of namespace) when it creating.

The default templates for the Sitecore Items is in the following folder:
C:\Users\<username>\AppData\Local\Microsoft\VisualStudio\12.0\Extensions\<install-id>\ItemTemplates\Sitecore
Extract Sublayouts.zip file from Sublayouts folder, move the using statement to outside the namespace in Sublayout.ascx.cs and re-pack the zip file. Restart Visual Studio and the changes should take effect.

Related

Unable to expose existing control on a new project form

TFS 2017 on-premise Version 15.117.27024.0
I have a custom Work Item field which exists as a global field, and has been added to work item templates in other projects on the same instance without issue. I've added the custom field to the User Story template for a new TFS Project (which uses the same TFS project template as other projects), and added it to the layout under the 'Value Area' control. Whatever I try, I cannot get the field to show in the web UI of TFS, but when I preview form using the Visual Studio Process Editor add-in, the field shows.
I've tried moving the control into another group, a different column, re-ordering the controls in the column, cleared cache, tried incognito, tried another users machine who has access to the same project. When the other user edits the template, he can see my new field in the template editor.
Exported the XML for the WIT using witadmin, and the elements are there as expected as a Field and as a control in the correct group & column.
In TFS 2017 and higher versions the fields should be exist also in the <WebLayout> to be displaying in the TFS web interface.
In your case the field exist only in the <Layout> so you can see him only in Visual Studio.

How do I add a new Razor Page Template to Visual Studio in ASP.NET Core 2.1?

I've got the Templates folder in my project hierarchy, and I've been modifying those pretty heavily to speed up my scaffolding workflow.
However, some of the objects in my database must persist forever. So, since they can't be deleted, they have a boolean activation state.
As such, I'd like to add two new actions to the CRUD workflow, Deactivate and Reactivate. I added the relevant templates to the Project\Templates\RazorPageGenerator folder, but when I click to add a new Razor Page, it still only shows the standard CRUD options.
I'm not sure where I need to register the new templates for them to be usable in the scaffolding operations...?
This is what I normally do and works all the time:
Right click the folder => Select Add > New File => Select Razor Page and modify the "Name" section to match my controller method name.
If it doesn't work for you, how about creating files "Deactivate.cshtml" and "Reactivate.cshtml" using normal means (Finder in MacOS, Window Explorer in Windows, or command prompt), copy them to your Project\Templates\RazorPageGenerator folder, and add them to your project by right click the folder in VS2017 => Select Add > Add Files from Folder
In .csprog change Project Sdk From Microsoft.NET.Sdk To Microsoft.NET.Sdk.Web

Joomla 3 Template override a plugin

I could not find any info on overriding a Joomla plugin in my template.
Some forums claimed there was no plugin override, and the Joomla documentation (being the menacing forest that it is) either has nothing on the subject, or the page is hard to find.
So how can we override the output of a Joomla plugin in the same was we override the output of com_content or mod_contact?
I have found a way to do this:
Navigate to <joomla_homefolder>/administrator/language/<your_language>/
Search for the plugin's corresponding language file.
Copy the file name, EXCLUDING the language prefix (ie en-GB.) and the .ini suffix.
In your template create a folder named html (a common practice for template overrides).
In the html folder create a subfolder and name with the language file name as you copied it in step 3.
Navigate to the tmpl subfolder in the plugin's path: <joomla_homefolder>/plugins/<plugin_type>/<plugin_name>/tmpl
Copy the view file you wish to override into the folder you've created in step 5.
Modify the copied file to override the plugins output.
For example -
To change the page navigation buttons - modify the output of <joomla_homefolder>/plugins/content/pagenavigation:
Go into <joomla_homefolder>/administrator/language/en-GB/ and find the file named en-GB.plg_content_pagenavigation.ini.
From the filename copy only plg_content_pagenavigation.
Create a folder named html (If it does not exist already) in your theme, inside it create a subfolder and name it plg_content_pagenavigation.
Copy the view file <joomla_homefolder>/plugins/content/pagenavigation/tmpl/default.php into the plg_content_pagenavigation folder you just created.
Modify the file.
Note: I have tried it only with Joomla 3.1.
The method may not work with some plugins.
Good Luck.
In joomla 3 you can override plugins output only, that's why the origin plugin must be implemented with a tmpl.
The naming convention of the folder in you [template]/html is
plg_[type*]_[pluginElement]
Template overridden native joomla plugins is only the pagenavigation.
type* : obviously there's no sense to be other than content but if it's custom plugin no one can stop you.
On a Joomla 3.1 install, I am using the Simple Image Gallery plugin and I felt the need to override it in order to add extra functionality to each thumbnail of the gallery.
I copied all of the contents of <joomla_homefolder>/plugins/content/jw_sig/jw_sig/tmpl/ into the folder <joomla_homefolder>/templates/protostar/html/jw_sig/ and I was then able to modify both the default.php file for output modifications, and the accompanying template.css file for styling modifications. This successfully overrides the plugin's output without risking issues during future updates.
Of course, this will not work with all plugins, but it offers another alternative if you have a plugin that was nice enough to be developed with a tmpl folder.
No you can't override the same way because there is not tmpl folder because plugins really should not be rendering though of course a lot do. You probably need to clone the plugin and make a the layout your want possibly using a jlayout to make it easier to manage.
Elin's answer is not quite correct for Joomla 2.5-3.x. Some plugins do render screen output and have /tmpl folders that you may be able to override. See http://docs.joomla.org/Layout_Overrides_in_Joomla
In some cases you may need to create alternative views within the plugin /tmpl folder. For example, some of the simple, newer custom content components that use JForms let you add fields to com_content articles and select a view template for each field. Then overrides for com_content are generated dynamically to display the custom fields. Each field type can be displayed in the component area through plugins, or in a module, or within the template code, but it will use the /tmpl file you selected for the field in the CCK component. If there is a way to override the different field views from within the template folder, it must require an arcane menu structure I haven't been able to discover.

Sitecore core database - How to add a new template

I need to make a new template in Core database to create some configuration items.
By default you can not add a "New template" to templates/System... section.
How can I add a new template to core database?
Right-click the location you want to create your template, click Insert From -> select Template (or Standard Template if that's what you want)
You can find this in /sitecore/templates/System/Templates/Template.
By the way, it's not generally recommended to add your template to the System folder. Might be better to add it to either a new folder or the User Defined folder.
By right clicking Templates >> System folder select Insert >> Insert from Template option in the popup menu.
Select /sitecore/templates/System/Templates/Template as Trayek suggests.
Added Data in the Builder tab and Inheritance tab also works fine. (Screen shot below)

SharePoint - List of Folders

I'm trying to implement a list where the only item type is a folder. If someone click "New" they are brought to a form that allows them to enter a folder name, description, and select either "Active" or "Inactive" from a drop-down menu. Inside the folder I want a simple list with only 2 columns.
I tried making a custom Folder content type with the columns I needed and making it the default content type. This seems to work to make the list of folders. Once I go inside the folder and try to change the internal view/list setting (I don't want to use the custom folder content type inside the folder...i just need 2 simple columns) it changes the settings for the list of folders as well. Is there any way for the internal list to have different settings than its parent?
I don't know if this issue is still relevant, but maybe someone else will find my answer useful.
I used to implement a list that contains only folders in the root, which in order can contain few item based content types.
There was two event receivers for FeatureActivated and ItemAdded events, which changes UniqueContentTypeOrder property (the list of content types available for user to create) of the lists root folder and a folder being created respectively. Like this:
List<SPContentType> ctl = new List<SPContentType>();
foreach (SPContentType ct in lst.ContentTypes) if (ct.Id.IsChildOf(SPBuiltInContentTypeId.Folder)) ctl.Add(ct);
lst.RootFolder.UniqueContentTypeOrder = ctl;
lst.RootFolder.Update();
Also, I designated different available list views for root folder and the folders it contains, by specifying ContentTypeID attribute for a View definition.
Unfortunately, no. Since SharePoint is Lists are not relational data, the only options to you are allowing several Content Types. If a content type is available to the list, it's available to the entire list (root, and sub-folders).
One possibility to model what you are trying to accomplish relies on SharePoint 2010 Enterprise. Infopath allows you to customize the New Item Form for a List. It might be possible to edit the form such that it only allows Folders on the Top Level, and List Items within a folder, but I don't know for sure - it's been a while since I customized a List Form with Infopath.