Using code snippets as 'functions' of sorts in a web developer's IDE? - ide

ok so this is somewhat of an awkward question, but lets put it like this...
I have a website with about 15 pages... Thanks to HTML5, I have a distinct and for the site. The content in these sections is fairly complex (with navigation menus and what not).
Now here's the problem, on Monday, (when I completed the site) everything was fine. On Wednesday, I realized that I need to add another item to the navigation menu in the , and change the parameters of some elements in the ...
Any simplistic way of doing this, other than editing one file, and then copy/pasting into each and every other file manually one by one?
Is there a good IDE out there that will allow me to just add a as a snippet in many places, and if I edit the master snippet, it auto-changes everywhere else?
Hope I'm being clear here...

Well… first thought: is server side scripting out of question? If so, maybe server side includes can be utilized? Whichever IDE you'd use, it'd solve only part
of the problem, leaving real architectural problem untouched.

Related

BEST File Update Workflow Process?

SUMMARY:
I need the most efficient workflow to individually edit over 200 files, and have them automatically disappear from the search results as they are updated.
DETAILS:
I am in the process of adding logging throughout a legacy system, and need to update over 200 files, each with their own custom code. I need to edit them one by one, and would like for the updated files to automatically disappear from my working search results after I have completed each one. The idea is to know how many and which ones still need to be updated as I slowly work through them all.
I already had to do something similar a few months ago, but on a much smaller scale, and I used an old-school HACK to do it. I did a search and replace for my keyword, and intentionally misspelled it. I then used the misspelled keyword for my search, and corrected it when editing each file, hence automatically removing it from the list. It "works", but is obviously a TOTAL HACK.
I recently started using IntelliJ IDEA, and am not yet familiar with the more advanced features like Find in File Scopes, Search Structurally, Search Templates, etc., but I am sure there HAS to be a "correct" way to do this in IntelliJ, and I just don't know how.
I am currently using "Find in Files" to work through the list, and recently found "All Changed Files" in the Scope list, which is actually the EXACT OPPOSITE of what I need. Is there a way to show "All UNCHANGED Files"??? That would work PERFECTLY in a pinch! But really, I would rather learn the CORRECT way to do this in IntelliJ.
Thanks!

How to open multiple file trees in IDEA (WebStorm)

Goal: View multiple scopes(file tree) at once.
I'm modifying a little old web node application, the view folder and logic handling are written in different places, but I need to see each other.
So, I would like to have multiple file trees in the same project for easy navigation.
However, since the folders are so far apart from each other, I set up a scope and try to switch between them each time.
Sorry, my English is not very good, so I use a little translation. I'm attaching a picture just in case.
Thank you.
I was able to find a few solutions.
It is the Favorites window.
Maybe the scope is not available, but I was able to increase the number of project views to two.
I can't open more than three of them, so if there is a convenient way to do this, please let me know.
Thank you.
screenshot

off topic autocomplete suggestions

Can't remember when, but a while ago IntellIJ started to show suggestions in the autocomplete suggestions that seem off topic. Very often the "wrong" suggestion gets to the top of the list and ends up in the code. This starts to get annoying. ;-)
I wonder where it is coming from (what language is it?) and why does it shows up editing java files?
Example:
Starting to type, CTRL+Space, suggests:
Pressing Enter inserts:
This is just a single example it happens here and there.
Seems you have some non-default live templates configured? E.g. in this example the template has the fina abbreviation.
Delete them from your configuration for the IDE not to offer them in completion.

silverstripe dynamic backend for flexible frontend

I'm searching for a while, but didn't find a practical answer for the following problem:
An Articlepage in the Frontend can contain different types of sections. For example a block text section and than a text section with left photo an at the end an wallpaper photo.
Now I want to implement this in my backend dynamically, so that I can choose, which type of section and -even more important- how many sections my article should contain.
In my recent project I've solved the problem as an Articlesection with a Dropdown, wich contains the different section styles. And one article hat xy Artilesections as childpages. In the frontend I included all Childpages of the Article - so to speak the Articlesections, where I've checked with if conditions, which sectionsystyle I have in this Section and here I styled the section as I want.
For example Artilce1 has 2 Childpages: Articlesection1 and Artilcesection2.
In AS1 I have choose in the dropdown: right text with left photo and check with if conditions, to style the section. The same with AS2, that is for example a wallpaper photo.
This semiprofessional solution worked, but there are some bugs with displaying the Article correct in the backend, because I have to declare the Articlesections as Includes and not native childpages. And in generell this don't seems like the developers of silverstripe want the users to do it this way..
Are there better ways to implement a dynamically changing backend, so I can decide, which and how much sections I have in the frontend.
Take a look at https://github.com/sheadawson/silverstripe-blocks. There's quite a few addons that offer similar functionality as Blocks such as Elemental. The following blog post might also be useful too - https://www.silverstripe.org/blog/silverstripe-strips/.
Thank you for your reply, but there is a problem, because I don't work a lot with the terminal and the composer. In principle I want to install sheadawsons silverstripe-block. I have installed the composer and run the command:
"composer require sheadawson/silverstripe-blocks" it seems like it installed that correctly, because I became no errors, but what then? With dev/build -to refresh the database- happened nothing and the following instructions in the readmy chanced nothing. Should I copy any files in my Sivlerstripe web folder or what else..? I'm a bit desperate, because there is such a poor documentation.
Tank you

Ektron 8.5 adding temporary paragraphs. Why?

We are running Ektron 8.50 SP2(Build 8.5.0.356) / eWebEditPro.
The issue we are seeing is when a smart form text field is left blank it is randomly filled with the following...
<Body>
<p title="temporary paragraph, click here to add a new paragraph"> </p
</Body>
Anyone else come across this?
I realize the most obvious 'next step' would be to upgrade. Unfortunately for many reasons this is not an option.
Any advice would be appreciated.
Thanks,
ozmo
You're right, the obvious answer is to upgrade. Ektron moved from eWebEditPro to Aloha as the editor of choice precisely because of issues like this that cropped up as they fought to strike the right balance between cleanliness and usability (prior to this issue, editors would complain that they couldn't get the cursor into the blank space as they wanted... it was a mess).
So my first question is: why can't you upgrade? Is it a business problem or a technology problem?
No other editor is going to be embeddable into the workarea besides, perhaps, their old ActiveX plugin that only works in IE and probably not some of the later versions.
So without an upgrade on the table, your only other options are to:
Edit outside of the workarea. This would require you to create and secure your own admin pages, but it would allow you to set up the form for input however you like and with whatever editor you like, as long as you XML encode any special characters (which is different from HTML encoding; note the 'space' above is   and not ).
Create an extension (aka "Content Strategy") which would do the clean-up you want as the item is being saved or published. Documentation for creating a strategy is in the Ektron docs, accessible through http://documentation.ektron.com (redirects to Episerver World, but to the page with links to the docs). You would have to create the strategy, insert your own logic, then add it to the site.
Let me know if there's more info I can provide. But I can't solve for this specific case since I don't have a comparable version of Ektron installed anywhere.