Long titles are being cut (with ...) in Appixia app blocks view - shopping-cart

I have an Appixia app and I'm creating a carousel of products. Each product (item) in the carousel is implemented using the GenericStaticBlocksCellView \ DynamicBlocksView module
I've added the product titles by creating a block of type Text and specifying Field = Title
I've also given the block width and height, the height is big enough to fit several lines, but if my titles are too long, they are just cut off at the end (and a ... appears).
How can I fix my long titles so all the text appears?

By default, text blocks only show a single line of text. So it your titles don't fit in a single line, they will be shortened, no matter how tall your block is.
You can override this behavior by using the MultiLine property of the block. Set it to true and then your text will span several lines.
Make sure the block is tall enough (using the Height property) to hold all of the lines that you need

Related

How do I add space between List items in SwiftUI

I am trying to add space between each list item and separate them out (see images for further explanation).
I have tried adding padding, but it only adds to the text, not the items themselves.
What I Have:
What I Want:
#Sweeper is correct. You want to place each view from the List in a Section. That will separate each concert artist and date from each other. Adjust spacing according to however you want it.
List {
Section {}
Section {}
Section {}
}

How can I define each case of the choice list in a uitable (GUI) and put IF function for each one?

I made a matlab gui that have two uitables, one of them have choice list format on its cells but I dont know how define each case of choice list and put IF function for each one. In other words I want apply numbers to second uitable from another gui with dependency on cases in the choice list of first uitable.
I assume that you use guide to manage your GUI, and that you already have created a uitable with a column in the format of a choice list, and that you have set the ColumnEditable property to true. Is that the case?
Then, create a CellEditCallback function by right clicking on the uitable in the guide window and select "View Callbacks" -> "CellEditCallback". This will create the callback function if it doesn't exist so far.
The automatically created callback function could look like this:
% --- Executes when entered data in editable cell(s) in uitable1.
function uitable1_CellEditCallback(hObject, eventdata, handles)
% hObject handle to uitable1 (see GCBO)
% eventdata structure with the following fields (see MATLAB.UI.CONTROL.TABLE)
% Indices: row and column indices of the cell(s) edited
% PreviousData: previous data for the cell(s) edited
% EditData: string(s) entered by the user
% NewData: EditData or its converted form set on the Data property. Empty if Data was not changed
% Error: error string when failed to convert EditData to appropriate value for Data
% handles structure with handles and user data (see GUIDATA)
In this case, the tag of the uitable is uitable1. If your uitable has a different tag, the function name will be according to that tag.
Now, write your if block into this callback function. For example, if the choice list that you want to query is in the first row and first column of your uitable, and you want to check if the selected text of the decision box is "blabla", then your code would look like this:
if strcmp(handles.uitable1.Data{1,1}, 'blabla')
% put here the code that you want to execute if the user selects 'blabla'
end
Hope it helps ...

Sitecore TreelistEx used as a UI for multi-link layouts

I need to present a content editor interface that allows editors to select specific pages in order to generate a link list for website visitors.
It seems treelist/treelistEX is providing the expected interface and I have combined that with a source path to lock the editors to a start destination rather than the entire sitecore tree. Opted for treelist EX as this appears to be the most efficient way as it doesnt render the tree in full each time unless its called upon.
In terms of the output however I'm getting a pipe separated list of GUIDs- is this something I need to iterate through manually using linkmanager or some such to obtain the items title and its sitecore link? Or is there an existing process that manages such a multi-list and breaks it up into its components.
If anyone can provide an example of that code and how to draw out the title and URL that would be great.
Thanks
There is no built-in solution for getting title and url from the items selected in Treelist.
You can treat your Treelist field as a Multilist field (they both store just list of pipe separated IDs in the background) and use GetItems() method:
Sitecore.Data.Fields.MultilistField treelistField = Sitecore.Context.Item.Fields["myTreelistFieldName"];
Item [] selectedItems = treelistField.GetItems();
foreach (Item item in selectedItems)
{
string itemName = item.Name;
string displayName = item.DisplayName; // fallback to Name if not set
string title = item["Title"]; // assuming there is a field called Title
string url = LinkManager.GetItemUrl(item);
}

Checkbox layout in Django manager

A minor but rather annoying flaw in the default layout of forms in Django manager apps is the positioning of checkboxes where the checkbox and its label are positioned in the first column and its help text (if set) is aligned in the second column:
Either the checkbox and label should be positioned in the second column or -better- the label should be aligned in the first column (with all other labels) and the checkbox positioned in the second column.
I presume the chances are slim, but is there a relatively easy fix for this?
If you can do it by adding css, then it is relatively easy:
class MyModel(admin.ModelAdmin):
class Media:
css = {
'all': ('/path/to/css.css',)
}

Sitecore 6 - how to store html-formatted text and reference in codebehind

I would like to be able to store reusable html-formatted text in Sitecore and reference in codebehind for inclusion in a custom user control. What is the best practice for doing this? If a user selects option A, for example, I would reference standard text A in my control. Any examples for how to accomplish this are appreciated. Thanks.
You have a couple options:
Store the text in the Standard Values of the same template that defines your option list. That makes it available on the same item, but standard for all items. Use security to lock down the field if you are worried about it being edited. This could also be accomplished with the new "cloning" feature in 6.4, I believe.
Create a structure outside of your Home element for storing this data. Based on the option selected, find an item in your content tree which corresponds to the selected item, and read the text off of it. You would need to find this item either relative to /sitecore/Content, or relative to your website root if multi-site support is a requirement.
No.2 in pseudo-code:
//get the item where we have the text values
Item textBase = Sitecore.Context.Database.SelectSingleItem(textBasePath);
//find the child w/ the same name as the selected option
Item textItem = textBase.Axes.GetChild(selectedOptionValue);
string value = textItem["text"];
I think I would do something like techphoria414's 2. option:
ie you have your normal "page" templates as per usual, but then you have some fields (multilist, treelist fields), where you put the source pointing to your other items contain the different texts.
then you basically just have to get the items from the current item (with some very quick'n'dirty code/pseudocode):
var CurrentItem = Sitecore.Context.Item;
Sitecore.Data.Fields.MultilistField mlf1 = CurrentItem.Fields["myExternalTexts"];
if(mlf1 != null)
{
foreach (Item itm in mlf1.GetItems())
{
lit += Sitecore.Web.UI.WebControls.FieldRenderer.Render(itm, "richtext");
}
}
You ofc shouldn't just add them to a literal and you should you Sitecore built in Field renderes if using Sitecore 6 or above and it's a Rich text field.
I hope that helps.