Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

The Background/Links...

10 years ago

I am going to include scripting in Warriors: Rise of StormClan. I was using this article for assistance.

I currently have the title part down, but what about the background and the "click to play" link? For your information, my goal is to create a cover-style page at the beginning.

I got the link of my background and placed the URL in its code, but when I paste it at the beginning of my page before the text, it disappears after I save my changes. Afterwards, I try putting the code in the title, but that just changes the toolbar's appearance of the Chapters and Pages part of the editor, so I deleted that.

Any advice?

The Background/Links...

10 years ago

If you don't want your code to be messed up, here are some options:

  • Save while still on source view
  • Don't use the rich text editor
  • Use a page script

You're not talking about the description and comments page, right?

The Background/Links...

10 years ago

No, I'm talking about a page in the story itself.

The Background/Links...

10 years ago

For the background, put $PAGETEXT := $PAGETEXT + "<style>body{background:url('URL');}</style>" in the page's page script, replacing the URL with the proper link. As for the title text, if it affects its appearance in the editor, that means it's working.

The Background/Links...

10 years ago

I tried to do the script, but it didn't work.

That is the script for just one page, correct?

The Background/Links...

10 years ago

Yeah. For whatever page you're changing the background of. Out of curiosity, what's the URL you're using?

The Background/Links...

10 years ago

http://chooseyourstory.com/resources/images/user/36884?36884

(Yes, I know I didn't make an actual link.)

The Background/Links...

10 years ago

I just tested $PAGETEXT := $PAGETEXT + "<style>body{background:url('http://chooseyourstory.com/resources/images/user/36884?36884') center center / cover;}</style>" in a page script and it worked for me. (That "center / cover" stuff stretches the image to the size of the page.)

The Background/Links...

10 years ago

Thanks, it works perfectly now!

Now, about the "click to play" link...

The Background/Links...

10 years ago

What do you mean by it "changing the toolbar's appearance" and what code did you try in the page's title?

The Background/Links...

10 years ago

<body background="URL">

When I placed it in the title, the toolbar where Home, Storygames, Forum, etc. are had changed.

The Background/Links...

10 years ago

Edit: Never mind.

The Background/Links...

10 years ago
An easier way than what is described in the article (for me anyway) is to use the "Inspect Element" feature of whatever browser you are using.  Bradin might have a better way...

The Background/Links...

10 years ago

Computer's broken, I'm on a tablet. I don't think it has that option.

The Background/Links...

10 years ago

iPad?

The Background/Links...

10 years ago

Yup.

The Background/Links...

9 years ago

There's an app for that, but I don't recommend it. Your best solutions are either temporarily enabling sneak peek or adding a coauthor to have someone find out the right code for you, or start with <a onclick="PostBack('FollowLink','1');return false;" href="#">LINK</a> and keep incrementing the "1" until the link takes you to the right page. (This goes in the source, by the way.)

The Background/Links...

10 years ago
Are you putting it in the window that pops up when you click the ":=" button to the left of the page title?

The Background/Links...

10 years ago

No.

Wait, no wonder part of my code is screwed up...

The Background/Links...

10 years ago
Yeah, some of the articles can be confusing until you get the hang of it.

The Background/Links...

10 years ago

No wonder. *facepalms* Dang it...

Well, it's fixed for the most part. Thanks!

The Background/Links...

10 years ago
@BradinDvorak did the hard part.  I just had the same issue at one time.  :)