Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Where are the actual php pages in SS? And does image alignment work in tinymse?


Go to End


19 Posts   2977 Views

Avatar
novaweb

Community Member, 116 Posts

20 March 2012 at 11:53am

You shouldn't need to do any thing like:

<div style="text-align: right; margin-left: auto; margin-right: 0; width: 100%;"><img class="right" src="assets/MyImage.JPG" alt="test" title="test" width="100" height="100" /></div>

The point of using a CMS, such as SilverStripe, is to be able to create web pages without having to use any code whatsoever.

You need to put:


<div class="typography">

in your template somewhere, in the theme that you are using (not the tutorial theme)

If images are wrapped in a div that has the class typography then everything should work fine.

Avatar
timetraveler

Community Member, 10 Posts

20 March 2012 at 12:20pm

Correction ...

The div is actually not necessary. This alone positions the image at the right side with text wrap:

<img class="right" src="assets/MyImage.JPG" alt="test" title="test" width="100" height="100" />

But the following defeats it:

<div class="captionImage right" style="width: 100px;">

The above div is inserted by tinymse when placing the image.

Repeating the process to check, if I start with no image, place the cursor before the first word of the 2nd paragraph, and insert the image, it appears at left with no text wrapping.

If I then remove the div manually, the image appears on the right, with text wrapping, as should be the case.

So tinymse is adding a div that should not be there. IMO.

Avatar
novaweb

Community Member, 116 Posts

20 March 2012 at 12:25pm

You should not need to make any edits to any html code if it is configured correctly. Perhaps this will help

http://www.w3schools.com/css/default.asp

Avatar
timetraveler

Community Member, 10 Posts

20 March 2012 at 1:21pm

novaweb,

In my 4th post in this thread (on page 1), I replied to you, identifying my SS version as 2.4.7. I also listed the files in which I had found

<div id="Content" class="typography">

as follows:

ArticleHolder.ss
ArticlePage.ss
HomePage.ss
Page.ss

These files are in themes/tutorial/templates/layout/

In the Black Candy theme, in the following folder,

themes/blackcandy/templates/layout/

I have found <div class="typography"> in the following files:

Page.ss
Page_results.ss

Are these the files in which <div class="typography"> should appear?

Thanks.

Avatar
novaweb

Community Member, 116 Posts

20 March 2012 at 1:31pm

Hi TimeTraveler,

That entirely depends on which theme your site is set to use in mysite/_config.php or in the CMS

It will be completely ignoring:

themes/tutorial/templates/layout/

ArticleHolder.ss
ArticlePage.ss
HomePage.ss
Page.ss

and

themes/blackcandy/templates/layout/

Page.ss
Page_results.ss

If the theme your site is set to use is neither Blackcandy or Tutorial.

So: In YOUR theme, make sure class="typography" is specified in the div containing your content.

Cheers,
Josh

Avatar
timetraveler

Community Member, 10 Posts

20 March 2012 at 1:43pm

The CMS indicates that my present theme is Black Candy. Using the cPanel file manager, I have navigated to

themes/blackcandy/templates/layout/

and when I open these two files:

Page.ss
Page_results.ss

I see this at the top:

<div class="typography">

If this is correct, then there must be another reason why tinymse is inserting an incorrect div when I insert an image.

I would be interested to hear your thoughts.

Thanks.

Avatar
novaweb

Community Member, 116 Posts

20 March 2012 at 1:53pm

Edited: 20/03/2012 1:54pm

Hi TimeTraveler,

My thoughts are as follows:

Download WAMP
http://www.wampserver.com/en/download-wampserver-32bits/

Install a development environment on your local machine and get it working there before trying to get it working in on a real web server.

Then, once it is working:

Download FileZilla
http://filezilla-project.org/download.php

and upload your site back up to your server.

Using cPanel to make edits to code is a really inefficient way of doing so. Using FTP to upload/download your code edits in the future will save you a lot of time.

You may also need a text editor, such as http://notepad-plus-plus.org/

Alternative:

Delete everything and do a fresh install of SilverStripe. WYSIWYG and Image Alignment works perfectly out of the box.

Cheers,
Josh

Avatar
timetraveler

Community Member, 10 Posts

20 March 2012 at 1:54pm

As an additional test, I unpacked theSS 2.4.7 download on my local xp computer, and search the contents for "captionImage".

Windows found the string only in these files:

tiny_mce_improvements.js - in three different sapphire\javascript folders
and in lib.js which is in assets\_combined files

The string does not appear in the blackcandy or tutorial themes.

Hence, it seems to me, tinymse is expecting a style that does not exist in the two default themes, which are blackcandy and tutorial.

Thanks.