Umbraco 7 Macro Rendering - umbraco

Im using Umbraco 7 for an Intranet. I was hoping to replicate some functionality that is in the backend, ive noticed when it renders the macro in the backend it will load the macro after / during the full page load.
I was hoping to replicated that same functionality in the front end, so that it can load the full page quickly then render the macros as and when theyve fully rendered
Has anyone else done anything like this before?
Thanks
Ian

The reason it works like that in the back end of Umbraco is that the Macros are stored as custom markup in the RichText editor. There's some JS that looks for the code and then parses the macro details and loads in a representation of the markup into the editor.
If you want to copy the functionality of the back office, have a look at the source code for Umbraco and see if you can use the method that they use.

Related

Migrating complete HTML and Javascript application into vaadin UI components

Many thanks for your help and support. I am just a beginner in Vaadin 7 and I am badly need of help.
Let me explain,
We have a third party application developed in HTML and JavaScripts. On my PC, if i open the html page with the browser it works fine. Please find the application in the attachment.
https://drive.google.com/file/d/1mdxFaMJmUb2pSTdh87MC8oSaaDMGx19d/view?usp=sharing
Now the challenge is, I need to in-corporate that application (HTML + Javascript) into Vaadin 7 as follows,
In-corporate the Javascripts into Vaadin using AbstractJavaScriptComponent (This has been done somehow understanding the examples)
Now comes the challenge,
If you open the HTML in the textpad/notepad, you could notice lot of div tags from the " < body > " tag. The requirement is, each div tag is a html component and this should be converted into vaadin component with css styling and need to be displayed in the UI, so that based on the customer requirements, we can change the style css. I tried with custom layout but this is not way to be implemented as well, this does not require a widget and server side component to be implemented. Is there any other way to implemented ? I spending lot of time but all my efforts are in-vain. I just need the way forward to give me a right direction if you have any idea.

Making a basic SO-like WYSIWYG editor in Rails

I am relatively new to Rails, having recently completed Hartl's Rails Tutorial, and am now embarking on my first full fledged project. What I am interested in adding to my web app is something similar to the text input feature in SO, where you could type, and see directly how your text will turn out. After some digging around on SO, I have decided on using the gem bluecloth, which is Markdown implemented in Ruby, but now have the following questions:
I am unsure about how to tie what bluecloth outputs to the form_for helper. My understanding was that you could convert to strings via the function html = BlueCloth.new(str).to_html(), but I am unsure what to do when you have a text field as part of form_for, where I should plug in the bluecloth part? In other words, I am still a bit confused about the magic of typing in one box and seeing the item show elsewhere on the page.
Are the WMD bar button items and functions included Markdown editors (such as bluecloth), or would this be something I have to build manually? If so, how would I get something like the bold button to show "** **" in the editor as you type?
Thanks for your help!
As comments have noted, Markdown is a markup language like HTML, so its not easy to do WYSIWYG.
There are probably two approaches to getting this kind of functionality.
Server side
Post your markdown text to a server and get the server to return HTML. I've done this a lot in Python, but for Ruby this SO answer suggests maruku. The disadvantage of this approach is that it requires a server request every time you want to view the preview, and then some way to integrate that back into your UI without disrupting the user. Stackoverflow uses this approach with the WMD editor and some C# on the server.
Client side
Another option is to use a client side library to take your markdown "code" and generate html which you can then integrate into your page using javascript. An example of this is dillinger. This uses a textarea and something like showdown to render the HTML in the browser. I'm taking this approach one step further in a WYSIWYG Markdown editor I'm developing called demarcate.js
Or... ditch Markdown
The comments have already suggested alternative WYSIWYG editors... most of these are not markdown editors but rich text editors which produce HTML at the end. TinyMCE and wysihtml5 are good options and I've also used CKeditor before with some success - it has a cool "in-place" feature in the latest version which inspired my Markdown editor above.

Rails: How to change CSS/HTML view code on the fly like with jsfiddle?

Is there a way to edit your views and CSS and see the results on the fly like with a jsfiddle program? I can't seem to use jsfiddle when programming with Rails because so many of my views are Rails code.
Try the Webkit web inspector, or Firebug in Firefox. You can select any element, edit attributes, modify the css, and change the text on the page.
If you have your web running on a server (localhost works too) you can try WebPutty from Fog Creek guys to change your CSS and see the results on the fly. It's free for now.
You can read how to import your site here

How can I find where actually is the theme file?

I am new to Symfony and I need to work to a large project with many themes to modify them. How can I find where actually is the theme file in which module, just looking at the HTML browser output? Or do I need to look somewhere else, routing for example?
What you want to do is use the Web Debug Toolbar.
Once you have that running on the page, using appname_dev.php, simple click the view link and it will show you which templates have been used. If you need to know which layout to use then use logs link, click none the sfPHPView.

Display Flash Web Widget in a Delphi form

I would like to display the yahoo weather widget (or any similar flash or java based widget) in a Delphi application. I freely admit I don't quite understand what would be required to make this work.
Any suggestions on how this could be accomplished would be appreciated.
I'm using Delphi 7. All of the Widgets are just HTML Code, which when I cut & paste them to my Blogger page for instance, show up and work fine. I'm not sure how to take that same html code and use it in a Delphi form to get similar results.
Detailed instructions would be appreciated as well as an explanation. Clearly I don't quite understand how this works... I only know what outcome I'd like ;-)
Thanks Rob, it wasn't a memory issue, butt he admins did take care of it as you suggested.
Mark
Basically, you want to host the SWF ActiveXObject.
http://delphi.about.com/od/graphics/l/aa040103a.htm
As mentioned above you could host Flash's active X control for a flash control.
The other option is to use an embedded webpage (possibly loaded off the local disk) using the built in Delphi TWebBrowser control to show any web content including Java or Flash controls (as long as they are installed on the client).
Hope that helps.
I have a video on embedding flash into Delphi Applications Available Here. If the widget is a flash file (.swf) it should be fairly easy. The other option (as already mentioned) is to use the Delphi TWebBrowser component.

Resources