How to code a WMD plug-in for Elgg? - wmd

How do I code a WMD plug-in for the Elgg framework?

You should first study and understand views in Elgg. They are like blocks in Drupal, but have a wider context, like an include file. Elgg plug-ins now have a better structure, so you better go on with the newest version.
For the client-side JavaScript part, examine the TinyMCE related views, there you can see an example showing how to replace the text editor window. Then include your PHP functions in the plug-in's main file. Any initialization functions should be called in the init() function of your plug-in.

Related

How to delete aui.css from pages in Liferay 7

How to disable aui.css for custom pages in Liferay 7. Is it possible to do this somehow via portal-notmal.ftl
aui.css is coming in through the unstyled theme, which typically is the basis for every theme there is. That being said, you can override it and remove it this way. It's refined in the styled theme, and also in the classic theme (in the same github repo, you'll find it).
If you do so, note that you'll still have to deal with a lot of formatting on your own - the classes and other DOM elements will be generated, but it looks like aui now includes the Lexicon CSS that you'll have to simulate if you get rid of it. Why you'd want to do so, instead of accepting the defaults and overriding what you don't like, is beyond me.
Edit, answering to your comment:
You'd simply create your own theme (Linking to 7.1 here, see below) with any overrides that you'd like to have. There's not a single file with an option, as this configuration file would be too complex and unmanageable.
Also, you sound like you've just started building your site - my recommendation would be to always go with the latest release and use 7.1 (at this time) and note that 7.2 is around the corner, Beta 3 has just been released

Crafter CMS - Is there a way to link to another CMS document in RTE?

I need to be able to link to another document on the site in the rich text editor by browsing and selecting it without manually typing in a URL to the document. Is this possible with Crafter?
I looked through the documentation about the RTE configuration plugins, and it looked like maybe the insert-component or insert-linkBrowse plugins would do it, but I made an attempt to configure them and add an item in the RTE editor controls, but it had no effect. I couldn't find any documentation specifically about those plugins, so everything I did was just a (wrong) guess.
There is nothing out-of-the-box that addresses this use-case. Options:
Build your model such that it has a repeating group of item pickers after the RTE and then followed by another RTE if need be (this means it won't be inside the RTE), which would make things more structured and arguably cleaner
Build it as a customization (it'll be a TinyMCE plugin)
Wait for the feature to be built by Crafter CMS: https://github.com/craftercms/craftercms/issues/1412

Using latex in internet browsing

Why isn't possible (or feasible) to have latex code written on internet pages: latex being the page's source, like html.
This idea came when I was writing on wikipedia some math article and I realize that the current implementation is quite weak, either in presentation as some things that cannot be written inline.
So, a definitely prettier and simpler approach would be to introduce latex code within the page: the browser would interpret it and, using texlive or equivalent, compile the page with latex generated fonts. This could be inside a HTML, but the generation was using "pure" latex and not some javatex or else.
The latex interpreter could be a plugin of the browser, like Java once was.
This could have profound consequences, like scientific articles be shown on the internet without the need of .pdf or latex based documents be putted on internet in a one click away. The article was code with appropriate packages for internet viewing. The user could at anytime download generate the pdf equivalent of that page.
Any ideas why isn't this feasible /possible?
In general, using LaTeX for web pages is not a good idea - (La)TeX is designed for exact print output, not for a web view of some web page, where the exact display depends on window/screen sizes, user settings, etc.
Also, at least on my computer, TeX combined with a DVI viewer (or PDFTeX with a PDF viewer) is still quite slower than HTML with a web browser to render a similar sized page ... and there is no easy way to have DOM-like scripting for a LaTeX-page, other than regenerating it on each change. You don't want this.
For these parts where this makes sense (mathematic formulas), this actually already works: There are JavaScript interpreters for subsets of LaTeX (i.e. most of math mode), embedded in a normal HTML document. One example is MathJax, which is used on the more math-heavy (i.e. scientific) sites in the Stack Exchange network, like Cryptography Stack Exchange.

Employer wants any non-technical staff to be able to modify content - easy solution?

I'm in a bit of a pickle at work. My department designs a number of internal systems for the company, mostly data-reporting related. We have less than 10 true content pages that actually need to be maintained by a human. These pages were written in PHP and maintained through Dreamweaver by a non-technical staff members - they used the design editor, and avoided the code as much as possible. There were issues, but overall it worked well.
Recently this project was updated and converted to a ASP.NET Web Application. This resulted in some architecture changes, making the content harder to edit with a WYSIWIG editor (it's now revision controlled, it's compiled and thus must be re-deployed after modifications are made, etc.). We sort of assumed that the staff member who had been maintaining it would just continue to do so, now using Visual Studio's "Design" mode instead of Dreamweaver's. We were mistaken, and it isn't an option for technical and non-technical reasons.
The staff member will not be touching any HTML - we need a WYSIWIG editor (this is a requirement we were handed...no arguing with them over that). I started looking at CMS', mainly Drupal, but after a bit of playing around I see that content 'Blocks' don't really have a WYSIWIG editor, instead expecting HTML. Is this true for all CMS'? Is there some easy-to-setup CMS out there that comes with a WYSIWIG editor? Does anyone have any other ideas? Don't care what language it's in, I'll make something work.
This really isn't my area of expertise - I do application development primarily, with an occasional web front-end. Not sure I'm even asking the right question, but hoping someone can help.
WordPress makes use of TinyMCE, and it works pretty well for some NON techie clients of mine. You can write (PHP) scripts that will call the WP functions and pull the page content.
Back to the point, I have found the backend of WordPress to be usable and friendly to a good mix of people. We often use it for a backend and build something completely custom for the frontend, and have had good results.
http://www.cushycms.com/
They let you add easy WYSIWYG capability to any website, regardless of the technology used.
You just add a tag once in your source file, and let your users go to CushyCMS.com to add text content.
I am by no means a CMS expert, but I believe SiteCore might suit your needs. It is a .NET system, built on top of ASP.NET, and from my limited experience with it, the UI for business users is very usable.
Take a look on Joomla. It includes WYSIWYG editor. It is much simpler than Drupal
As Frank points out, TinyMCE is a great option, in fact you use it here :D. Have a look at some examples: http://tinymce.moxiecode.com/examples/full.php
The good point is that TinyMCE is just javascript, so in theory you can add it to any CMS, or in fact to any HTML form.
Also, I think is the default input method for Joomla if you are interested.
I would recommend CKEditor (the successor to the FCKEditor), I haven't used FCKEditor in ASP .NET code, but have used it in PHP with a lot of success. I haven't gotten around to converting old code to CKEditor, but plan to in the future.
If this is something where you can load HTML files from your server that has FTP access...a quick and dirty solution I have used is CushyCMS.com, you supply ftp credentials and hook up the files and they are good to go. Non-technical customers of mine have liked the editor a lot. It allows you to specifically say what you want edited and what you don't.
In PHP the way I usually architect using CushyCMS is to have the main page do a require_once on the content page and the content page has the HTML block that I want them to be able to edit.
so the code looks like this:
<?php
//...other code
require_once("page_content.php");
//...other code
?>
where page_content.php looks something like this:
<div id="whatever" class="cushycms">
editable text here
</div>
Hope this helps.
I used to think that for user friendly editing, you need a WYSIWYG editor, such as the TinyMCE that has already mentioned. Not any more.
Editing content in such a rich text editor is not very handy. Very often you end up messing up the content, and either does a technically savvy person have to come to help, or you have to switch to CODE view (= HTML) to clean up the mess.
Now I'd be far more inclined to use something Markdown, like this site (and Reddit) uses. For most purposes, you don't need rich text, and it is just as handy a WYSIWYG tool. If you need a few rich text touches, like making some text bold or italic, this works quite easily too. Lists, either numbered or bulletted, are a snap. And making links... Those WYSIWYG tools always seem to be able to mess it up in ways you can't even imagine.
Plus, this way, the resulting HTML is always clean and minimal, and it's extremely hard for the user to mess up.
What about Expression Web? It is made to edit ASP.NET web pages, and can integrate with TFS

How can I change language contexts in Textmate bundles?

I'd like to get my Textmate bundles to use the correct contexts based on what I'm editing. For example I use YUI a lot so I'd like the HTML bundle to use the YUI JS bundle instead of the standard JS one, etc.
Can anyone suggest where and what I should be editing to make that happen. Bonus points for tips on bundle editing.
The thing we are talking about here is scope. You'll have to edit your Bundle elements scope.
Let's take a look:
alt text http://mtod.org/so/scope.png
Now, edit the scope to a wider one, for example use source.js instead of source.js.yui. This should be applied to every snippet, command, etc. in the Bundle. You could probably do a search & replace directly on your Bundle files.
alt text http://mtod.org/so/edit.png
That's it. Bundle snippet triggered below.
alt text http://mtod.org/so/yui.png

Resources