How to edit HTML/CSS in browser via Dashboard? Uploading and editing via FTP?

Permalink
I inherited a site that uses Concrete 5 and am just getting to know how it functions. I'm coming from a front-end dev background and would rather just edit raw code to make simple edits. I am waiting on the FTP info, but wondering if there was a way to simply edit a page in edit mode or via the Dashboard.

Also, are their any common problems that might occur if I upload a HTML or PHP file via FTP instead of editing the blocks etc, through the browser edit option?

Thanks a bunch.

 
keeasti replied on at Permalink Reply
keeasti
Hmm ... I think you will find that you will have to edit via the CMS not by uploading php 'pages'
CMS's are not structured like traditional sites where there is one file per page. Rather, there are re-usable templates with palceholders areas (called blocks in C5) where data is 'pulled' in to from a database. Hope this makes sense.
MChiampa replied on at Permalink Reply
Yes, I understand. I edited a PHP file to make some changes and uploaded it via FTP. I was wondering how sensitive this CMS was or if there was any built-in features to edit the HTML in the browser instead of having to do it all back-end.
Phallanx replied on at Permalink Reply
Phallanx
@MChiampa

You place a content block in one of the predefined areas dictated by the template and click edit. You are then presented with the wysiwyg editor Tinymce to edit your HTML.

http://www.concrete5.org/documentation/using-concrete5/in-page-edit...

[quote]
Also, are their any common problems that might occur if I upload a HTML or PHP file via FTP instead of editing the blocks etc, through the browser edit option?
[/quote]

Short answer->It wont work. The CMS uses MVC.
https://en.wikipedia.org/wiki/Model-view-controller...
MChiampa replied on at Permalink Reply
I did upload a file via FTP, it worked fine as far as I can tell.
landollweb replied on at Permalink Reply
landollweb
Are you trying to edit a page design, or some of the page content?
MChiampa replied on at Permalink Reply
A little of both. There was an image, that was "the background" for a section of the page, there was a block over it with some content that I could easily edit in the browser, but the image and some other text, I couldn't. The only option I could quickly find was simply editing the file and replacing it via FTP. It worked fine, but I was wondering if there is some kind of editor in C5 that would allow me to do that in the browser. I am coming from a mostly WP background.

Here's what I had to remove. But I had to do it manually:

<section id="over-1-home">
        <h1 class="hometitle1">HEADLINE</h1>
        <article id="homeart">
              <?php 
         $a = new Area('homearticle1');
         $a->display($c);
         ?>
            </article>
        </section>


I couldn't find a way to edit the style id or the h1 in the browser.
Phallanx replied on at Permalink Reply
Phallanx
@MChiampa

Right. So you edited the theme template. That's fine. However, Concrete5 differentiates between themes and content. Theme developers create themes (usually installable packages) and content editors just put blocks in the editable areas. The problem with removing this code in your theme is that you have removed an editable area on all pages. The piece of code:
$a = new Area('homearticle1');
$a->display($c);


Defines an in-context edit area (where you can place a block). If you have blocks in that area on other pages, they will not show, nor will you be able to place anything else in that position on any page.

What theme are you using?
MChiampa replied on at Permalink Reply
This was the home.php page. I am using a custom theme. I don't understand why that would affect the block if it was on other pages (it is not). This is a temp edit and I was going to replace that code in a few weeks.
Phallanx replied on at Permalink Reply
Phallanx
@MChiampa

No. It is in the home page *type*. Any pages that use that type will be affected. Click on edit>>design and you will see the different types available and they will have different layouts and editable areas (each corresponds to a php file with that name in the theme directory). One of these will be *Home* .
MChiampa replied on at Permalink Reply
It's not on the other pages, and it's not going to be, that is not an issue. I was asking if I upload the original home.php file with that code I pasted up there, there shouldn't be any issues, correct?
Phallanx replied on at Permalink Reply
Phallanx
@MChiampa
Incorrect. I have just described the issues.
MChiampa replied on at Permalink Reply
I'm not having any problems right now. I am able to edit the other pages, and there are no other problems with anything. I don't understand the issue you are assuming I am having. I'm assuming I'd just have to make a new block, or write raw code when the time comes. Which is not a big deal.

I was asking about an in browser editor which I'm guessing at this point there isn't anything as detailed as I want. All of the other pages are single pages and aren't associated with home.php or any type. Thanks for your input.
mhawke replied on at Permalink Best Answer Reply
mhawke
Let me try.

If you type 'Page Search' into the Intelligent Search Box and choose the first result it will take you to a place where you can find out if any other pages are using the 'Home' Page Type (or 'layout' or 'template' or whatever you know it as). Since it's called 'Home' you are probably correct in saying it's only used for the one page but you can never be certain. Check the Page Search to be sure.

What Phallanx is warning you about is that if any other page in your site uses the 'Home' page type file for it's layout will undoubtedly have some blocks added to the editable area that you removed when you removed that code and so when you land on those pages, there will not longer be a 'container' area in which to render those blocks.

To answer your actual question. No, there is no direct access to the underlying PHP/CSS/HTML files from the Dashboard. I believe that is by design so that clients don't mess things up.

There was an add-on that promised to do this but it's not being maintained anymore and it doesn't work on 5.6. I've tried to get it to work but have not had time to really look into why it's broken.

http://www.concrete5.org/marketplace/addons/theme-editor/...

UPDATE: The add-on above actually works but gives you a nasty error message when you install it. Afterwards, it seems to work fine. I will continue to look for reasons why it throws the error upon installation.
mhawke replied on at Permalink Reply
mhawke
UPDATE #2: I spoke too soon. This add-on is dangerous. It blindly and un-intelligently copies and deletes theme files with total disregard to safety. You could easily overwrite or delete your complete theme with no recourse. As it sits, this add-on should not be in the marketplace.
Phallanx replied on at Permalink Reply
Phallanx
@mhawke

It says it copies theme files to the top level themes directory to work on, so it should be quite safe.

[quote]
This add-on copies original theme author files into the /themes directory, allowing the user to make updates with the ability to restore to the orignal state. This also ensures that updates to the original theme will not overwrite any modifications.
[/quote]

I'll download and have a play before it disappears as it looks very useful indeed.
mhawke replied on at Permalink Reply
mhawke
Two things...

Issue 1... If you have already made a copy of a packaged theme and put it in your '[root]/themes' folder and modified these files, this add-on writes over your modified files when it copies the package files to your theme folder.

Issue 2... If your theme only exists in the '[root]/themes' folder (like a lot of my themes built from scratch) then if you ever hit the 'Restore' button for that theme, it deletes the only copy of your theme.

Look in it's 'controllers/dashboard/theme_editor/themes.php' file at the 'prepare' and 'restore' functions. It does no checking at all before it over-writes existing files or deletes your only copy. It could be modified to do so but it doesn't right now.

You've been warned!
Phallanx replied on at Permalink Reply
Phallanx
@mhawke

OK. That makes sense (although I only ever use/write packaged themes).
Not particularly difficult to remedy though. Has the author abandoned it?
mhawke replied on at Permalink Reply
mhawke
I believe LucasAnderson's add-ons have been officially abandoned.

http://www.concrete5.org/community/members/?submit_search=1&sea...
MChiampa replied on at Permalink Reply
Yikes!
MChiampa replied on at Permalink Reply
Thanks! Yeah, after some research I kind of came to that conclusion about the editor. Add-ons with this CMS seem iffy and outdated. The site I am working on is v. small, about 15 pages. Again, I've never used this CMS before, coming from a WP and Drupal background so I'm treading lightly.
mhawke replied on at Permalink Reply
mhawke
Iffy and outdated? I beg to differ. This is the only add-on that I've come across in 2 years that I'd call 'iffy' and the developer has only abandoned it for personal reasons. I'm sure he is capable of tweaking it but life gets in the way sometimes. The c5 marketplace is 'curated' to make sure stuff works and compared to the broken nonsense the you have to weed through in the Wordpress and Joomla jungle, I'll take my chances here. It's free, open source and MIT. If it's not perfect, we fix it.

You say you inherited an old site. What version are you running? (Dashboard->System and Settings->Environment)
MChiampa replied on at Permalink Reply
Sounds good. I do not like Joomla, don't worry about that. Again, I'm brand new to this. What are some polished and useful add-ons you'd suggest? Is it unPC to blab on in this thread like this? Thanks for your help too, btw. The former dev left me with no instruction, I'm going on instinct and common sense.
mhawke replied on at Permalink Reply
mhawke
There is no 'political correctness' required here aside from the general rules of decency. Hey, I have upset plenty of people with my candor. If you show disrespect to the many, many generous volunteers who give their knowledge for free on these forums, expect the sky to fall. Like any community, you earn your right to criticize the status quo because there are a lot of good reasons why things are done the way they're done.

I have worked with old-school developers (like myself) who have cut their teeth on platforms like Dreamweaver and FrontPage and others who have worked with Wordpress, Joomla and Drupal. Without exception, I have found that the better you are at these platforms (or just building HTML pages in Notepad) the longer it takes you to get your head around building with concrete5. You have to let go and embrace concrete5. If something seems like it's too hard to do, you probably are looking at the problem from the wrong perspective. Instead of asking how to do something too specific, ask how you would accomplish your concept in concrete5 and you will learn more, faster.

You will find that there are numerous ways to build out a site in concrete5 and each paradigm has it's advantages and dis-advantages. If you download one of the newer, responsive themes like 'Grain' (free) you will see some 'best practices' in action.

http://www.concrete5.org/marketplace/themes/grain-theme/...

I didn't really understand c5 until I installed the 'Designer Content' add-on. That should keep you busy for the weekend.

http://www.concrete5.org/marketplace/addons/designer-content/...

The documentation section on concrete5.org is weak because it's very hard (and boring) to document a moving target so watch lots of training videos (search YouTube) and ask lots of questions and you'll get lots of good answers.

Welcome and Good Luck!
MChiampa replied on at Permalink Reply
Neat. That add-on might be helpful with my first Q. All comes back around. Thanks again for your help!