Expanding the use of PlaceHolderMain in Sharepoint 2010? - sharepoint-2010

I want to create a 2 column layout in my master template page. I want both the left and right HTML column < div >'s in my design to have wysiwyg editors. This is what I am picturing...
<div id="container">
<div class="left-side">
<div id="sub-menu">asp:menu</div>
<asp:ContentPlaceHolder id="PlaceHolderMain1" runat="server" />
</div>
<div class="right-side">
<asp:ContentPlaceHolder id="PlaceHolderMain2" runat="server" />
</div>
</div>
but obviously, PlaceHolderMain1 or PlaceHolderMain2 are not optional content placeholders to select by default...
http://office.microsoft.com/en-us/sharepoint-designer-help/working-with-content-placeholder-controls-HA102265026.aspx
Is there a way to create an additional HTML-PlaceHolder with SharePoint?

By creating content types for a content page layout
[configure SharePoint's site settings -> then view content types under 'Site Objects' in SharePoint Designer], you could then take advantage of your "toolbox" located in SharePoint Designer.
Create your types and your page layout under site settings from your browser
Also assign your page layout to a specific master template
Open up your new page layout in SharePoint Designer
Then use the toolbox to drag any of the available content fields into your content page layout.
Save your layout page, check it in as major. Done.
As a result, I was able to drag on a Rich HTML field PLUS a web zone, into each floating div in my content page layout. FYI, you may or may not need to add on additional Tagprefix's to your content page layout, for example, if you are calling the asp:menu into it, be ready for that...
The solution also keeps you from re-creating multiple master templates, just because you need a new HTML layout scheme to choose from.

Related

DotVVM - IncludeInPage displayed for a split of second during page load

When I use IncludeInPage property of DotVVM control, this control is rendered for a split of second during page load. Include in page contains value binding and while it is not evaluted this control is displayed I guess. This is quite disturbing. How can I prevent it?
Control example:
<div IncludeInPage="{value: Gender == Gender.Male}">
This text should not be displayed at all.
</div>
Workaround: If you want to hide/show the content staticly and need to show/hide it until reload of page, use resource binding.
<div IncludeInPage="{resource: Gender == Gender.Male}">
This text should not be displayed at all.
</div>
This does not apply to situation when you want to show/hide content later dynamically.

Loading content into Blazor TabControl

I've created a TabControl following this and similar guides:
https://blazor-university.com/templating-components-with-renderfragements/creating-a-tabcontrol/
The relevant code on my test Tabs.razor page is:
<TabControl>
<TabPage Text="Tab 1">
<h1>The first tab</h1>
</TabPage>
<TabPage Text="Tab 2">
<h1>The second tab</h1>
</TabPage>
<TabPage Text="Tab 3">
<h1>The third tab</h1>
</TabPage>
</TabControl>
The pages inside the tabs themselves will have a lot more content than just one sentence. All the tabbed examples I've found just have the tab contents like this, flat on the page. Is there some way to make the tab content more modular, possibly having it live in separate files? I'd want it all to load on the page initialization, I'd just like to not have a big monster .razor page with the contents of all the tabs.
I'm not sure if I need nested layouts here or what, or how the rendering would work (I'll need the tab contents to behave like top-level razor pages with functions and submit actions, etc...).
Pretty new to this, obviously, and haven't been able to find an answer. Thanks in advance.
<TabPage Text="Tab 1">
<MyFirstTabbedComponent />
</TabPage>
and then develop MyFirstTabbedComponent.razor as a page/component.
enfin, you have already done something similar.

how to link backend custom fields of product to product specification tab in bigcommerce

Under the "Product Specification" tab, i want to link this to the "Custom Fields" on the back-end(by "Back-end" I mean the control panel where you login and can modify the product) of the website. If you go to each product on the back-end, each product has a "Custom Field" tab that has the product specifications set up. I want the "Custom Field" contents in the back-end for each product to show under the "Product Specification" tab of the product's page.
Not sure if you're developing on Stencil or Blueprint, so I will explain both.
Stencil
In Stencil, first navigate to the templates/components/products/product-view.html file. Locate the custom fields code, and move it to the Product Details tab. Using handlebars, we will add the class name to the custom-field <li> and render the fields. If you only have one field, you may want to use a <p> tag instead of <li>.
{{#if product.custom_fields}}
<ul>
{{#each product.custom_fields}}
<li class="custom-field {{name}}"><span>{{name}}:</span> {{{value}}}</li>
{{/each}}
</ul>
{{/if}}
Blueprint
The Custom Fields Snippet, is located inside the ProductOtherDetails.html Panel. Inside this Panel, it calls the %%SNIPPET_ProductCustomFields%% which loops each custom field. Code below.
<div class="DetailRow %%GLOBAL_CustomFieldName%%">
<div class="Label">%%GLOBAL_CustomFieldName%%:</div>
<div class="Value">
%%GLOBAL_CustomFieldValue%%
</div>
</div>
I recommend adding the %%GLOBAL_CustomFieldName%% as a class on the DetailRow as a way to target each custom field using JS/CSS if you have more than one.
If you have more than one custom field and you only want to move the one field to the product description, I recommend using Javascript. Something like:
$('.DetailRow.CUSTOMFIELDNAME').detach().appendTo('.ProductDescription');
If you only have one custom field or you'd like all your custom fields in the product description, you can just move the Panel to the ProductDesription Panel which will render those custom fields in the product description.
Hope this helps.

django-autocomplete-light how to copy multi select fields

I'm using django-autocomplete-light with django 1.8.
I want to be able to copy the selected contents from one autocomplete field into another which requires overriding javascript code.
I tried duplicating the html content inside the autocomplete tool into another one in the browser debugger which looked good but when I click the save button in the admin page, it ignores my copied value.
Any ideas?
It works if you use an empty form for #form_template as such:
<div class = 'table' id="form_template" style="display:none">
{{ formset.empty_form }}
</div>
<div class = 'table'>
<table>
<!-- don't use #form_template in your actual form -->
From github issue

Content not shifting up when Diji TitlePane collapsed

Quite simple really.
I have two ContentPanes that I load content into dynamically. The content I load dynamically contains TitlePanes. When I collapse these TitlePanes the content below the TitlePane does not shift up.
(you may ask why I don't load the content into ContentPanes INSIDE the TitlePanes. The reason I don't do that is because the TitlePanes won't expand to cover the dynamic content)
The answer for this can be found here. All you need to do apperently is add doLayout="false
<div dojoType="dijit.layout.ContentPane" id="..." splitter="false" doLayout="false"></div>