Umbraco, adding attachments to articles in back-end and then showing them in front-end CMS - umbraco

On my Umbraco website, I have the section which shows latest News. Each news is one article.
Unfortunately, I can't add any attachments to any News article in back-end so users could see that attachment(s) on front-end of website and download them if they want to. This is how I it should look like
https://imagizer.imageshack.us/v2/895x383q90/826/cozp.jpg
Is this possible to do? While I was using Joomla CMS it was very easy by installing additional module/component which took me only 15 minutes to set.
Any help is appreciated and many thanks in advance for prompt replies!
MC2012

The solution is fairly simple:
Add the attachments to a folder in the 'Media' section
Add a field to the document type that the page uses called 'attachments' and use the datatype 'Multi-node Picker'
On the page content pick the attachments you are interested in
Render the list of attachments (http://our.umbraco.org/projects/backoffice-extensions/ucomponents/questionssuggestions/26638-Multi-Node-Tree-Picker-help-with-example-code-(in-Razor))
using something like:
<article>
#if(Model.HasValue("attachments")){
<ul>
#foreach(var item in Model.attachments){
var node = Library.NodeById(item.InnerText);
<li>
#node.Name
</li>
}
</ul>
}
</article>

Thank you very much for fast answer. However, in the meantime I have find solution. Here is the link
http://our.umbraco.org/forum/using/ui-questions/47616-Adding-attachments-to-articles-in-back-end-and-then-showing-them-in-front-end-CMS
I hope someone else will have some use of it because it is great solution.
BR,
MC2012

Related

How to add tables inside facebook instant articles?

In facebook format references https://developers.facebook.com/docs/instant-articles/reference nothing is mentioned about adding tables. When I try to add tables inside tags that is getting truncated by facebook. Is there anyone resolved this issue?
Thanks in advance for the help.
Tables are not supported out of the box. You can wrap them in an op-interactive though. They won't inherit any styling so you might need to add some styling as well.
<figure class="op-interactive">
<iframe>
<table>
[...]
</table>
</iframe>
</figure>

How to add link title in Typo3

I'm actually absolutely new to Typo3 and need some help. I've got a site (6.1.5) with a main menu - but none of the links has a title:
<li>
page1
</li>
<li>
page2
</li>
In the backend I can use "Page Title", but nothing appears in the frontend.
Thanks in advance!
Dublay
We need to know more to help!
Have a look at the template section in the BE Menu. Look if you find there an Object named TMENU. Is so, this would be your solution:
ATagParams = title="{field:abstract // field:subtitle // field:title}"
ATagParams.insertData = 1
Like that first the abstract is taken, if empty the subtitle, if empty the title.
Have a look here: http://www.serious-cool.de/webdesign/typo3/dynamische-linktitel-im-menue/
I you cannot find anything alike, your template is propably rendered with fluid. That means you have somewhere in your system a navigation.html file you need to find and modify.
Since Typo3 is very dynamically developing there are more then one possibility to render a menu....

How to loop through properties in a tab and display them using Razor?

I have a Document Type, that has a tab with some properties.
The properties are Upload types, and Simple Editor types.
(Users are supposed to upload images with some image text).
I have not grouped the "Upload" and "Simple Editor" properties, so how do i do this?
Next question,
I want to loop through each group (there should be 3 currently) and display them on my website.
The markup should look like the following:
<div>
<img src="PATH-TO-UPLOAD-TYPE" />
<div>"TEXT FROM SIMPLE EDTIOR TYPE"</div>
</div>
..
<div>
<img src="PATH-TO-UPLOAD-TYPE" />
<div>"TEXT FROM SIMPLE EDTIOR TYPE"</div>
</div>
...
I would like to use Razor for this. Thanks in advance!
For the first part, using the Razor model, you can't. The content object that you get on the front end only contains the properties, the tabs are not included, as they're only really for organising things in the back office.
You CAN get that information using the Umbraco API, but it's pretty database intensive and could potentially be quite slow if you have a lot of properties/tabs.
You'd be better grouping them yourself in your Razor Macro.
for the second part, you can acces the properties of a page via #Model.property. For example:
<div>
<div>#Model.simpleProperty</div>
</div>

How to edit autocomplete suggestion list using Jquery autocomplete plugin?

I am created a demo of autocomplete using http://jqueryui.com/demos/autocomplete/
plugin.
Now the suggested list which appears on pressing key is
<ul>
<li>
Suggestion
</li>
</ul>
I have to edit the list like :
<ul>
<li>
<a>Suggestion</a>
<br />
<a>data1</a><a>data2</a>
</li>
</ul>
how can I do this? I seen script for autocomplete but not found any hint.
You can configure the autocomplete with the formatItem, and the parse properties of the configuration object.
This question has been answered here:
JQuery AutoComplete results format?
Looks like you want to add some HTML to the result. If that is correct, the jquery ui docs point to a resource (at the bottom of the docs page):
The label is always treated as text, if you want the label to be treated as html you can use Scott González' html extension. The demos all focus on different variations of the source-option - look for the one that matches your use case, and take a look at the code.
Or, you can add custom data using the open event of the autocomplete. See example here:
http://www.jensbits.com/2011/03/03/jquery-autocomplete-with-html-in-dropdown-selection-menu/

How do I link to an item in the public folder from views/controller_name/page1.html.erb in Ruby on Rails?

I need to embed a flash movie into one of the pages in my Ruby on Rails app. I've put the Flash movie into the public folder, but I'm not sure how to reference it from my page, which is located at views/controller_name/page1.html.erb. How do I do this?
Thanks for reading.
link_to, eg (assuming it's in the public folder):
<%= link_to "My Hot Link Test", "/flashmovie.swf" %>
The leading "/" isn't strictly necessary, I think.
Sorry, missed the bit where you wanted to embed it, not link to it. Contrary to the title of this question. ;-) This is one easy way:
http://agilewebdevelopment.com/plugins/flashobject
we have done this, But we have just use plan html
say your flash banner is at
/public/flash/ folder
this is nothing but plain html
If someone have a better option please let me know too
cheers
sameera

Resources