HTML/CSS customization not saving on iPad; can't access Discourse on desktop


#1

UPDATE:
As explained below, I inserted customized HTML code in the CSS customization setting and was unable to access the Discourse content on my desktop. All I see is a yellow bar which I have added in. However, I was able to see the Discourse content on my iPad and iPhone; the only problem is that I can’t make any changes to the HTML/CSS setting because it simply wouldn’t save when I access it through my mobile devices. Please help!

ORIGINAL:
I just did something really stupid: I added some CSS code that seems to have completely covered up the content of my Discourse. Is there a way to get my normal Discourse page back without completely destroying my Discourse instance and setting it up again?

This link is supposed to show my Discourse but now it only shows my customized CSS:

Thank you very much!

This is the code that I inserted in </head>:

<meta charset="utf-8"><title>leasehackr forum</title><meta name="viewport" content="width=device-width, initial-scale=1"><meta name="generator" content="Webflow"><link rel="stylesheet" type="text/css" href="https://daks2k3a4ib2z.cloudfront.net/556bd117076367946935e4bf/css/leasehackr-forum.webflow.07018bad8.css"><script src="https://ajax.googleapis.com/ajax/libs/webfont/1.4.7/webfont.js"></script><script>WebFont.load({

google: {
    families: ["Pacifico:regular","Raleway:300,regular,500,600,700,800"]
  }
});</script><script type="text/javascript" src="https://daks2k3a4ib2z.cloudfront.net/0globals/modernizr-2.7.1.js"></script><link rel="shortcut icon" type="image/x-icon" href="https://daks2k3a4ib2z.cloudfront.net/img/favicon.ico"><link rel="apple-touch-icon" href="https://daks2k3a4ib2z.cloudfront.net/img/webclip.png">

This is what I put in the <header> section:

<div class="w-nav navbar" data-collapse="medium" data-animation="default" data-duration="400" data-contain="1"><a class="w-nav-brand w-clearfix brand-linkbox" href="#"><div class="w-hidden-tiny logo-txt">leasehackr</div><img class="logo-img" src="http://uploads.webflow.com/556bd117076367946935e4bf/556bd1ef076367946935e4c9_Leasehackr%20Logo.png"></a><nav class="w-nav-menu navmenu-div" role="navigation"><a class="w-nav-link navitem-linkbox" href="http://www.leasehackr.webflow.io" target="_blank">Latest Deals</a><a class="w-nav-link navitem-linkbox" href="#">LeaseCompare</a><a class="w-nav-link navitem-linkbox" href="#">Leasing 101</a><a class="w-nav-link navitem-linkbox" href="#">Lease Hacks</a><a class="w-nav-link navitem-linkbox" href="#">About Us</a></nav><div class="w-nav-button navicon-button"><div class="w-icon-nav-menu"></div></div></div>

And this in </body>:

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="https://daks2k3a4ib2z.cloudfront.net/556bd117076367946935e4bf/js/webflow.0ab006a10.js"></script>

I didn’t expect that the code will override my page. :frowning:


Customization not saving
(Régis Hanol) #2

If you’re still logged in as an administrator, then you can go to http://forum.leasehackr.com/admin and you will be able to fix your CSS :wink:


#3

@zogstrip Thanks for the response. I couldn’t access the admin page anymore because the yellow bar is all I see.


#4

I can no longer log into my Discourse instance. Would rebuilding the container fix the problem?


(Kane York) #5

No, because customizations are stored in the database and they’ll still be there after you rebuild.

However, I have to question some of your insertions. Why are you re-adding jQuery and modernizr? These are both already included in Discourse.


#6

@riking Thanks for the response. It was a complete mistake. Do I have other recourse other than completely wiping my Discourse and reinstalling it?


(Kane York) #7

Yes, you can do this:


#8

@riking I tried your code but it didn’t seem to disable the customization as my site is still broken:

root@forum:~# cd /var/discourse
root@forum:/var/discourse# ./launcher enter app
root@forum:/# rails c
[1] pry(main)> SiteCustomization.update_all(enabled: false)
=> 1
[2] pry(main)>

Did I enter something wrong?


#9

I also tried this, but still no luck :/:

root@forum:~# cd /var/discourse/
root@forum:/var/discourse# ./launcher enter app
root@forum:/# update site_texts SET value = '' where text_type = 'head';
bash: update: command not found
root@forum:/# sudo -u postgres psql postgres
psql (9.3.6)
Type "help" for help.

postgres=# \c discourse
You are now connected to database "discourse" as user "postgres".
discourse=# update site_texts SET value = '' where text_type = 'head';
UPDATE 0
discourse=# update site_texts SET value = concat('<!-- ', value, ' -->') where text_type = 'head';
UPDATE 0
discourse=# update site_customizations SET header = concat('<!-- ', header, ' -->') ;
UPDATE 1
discourse=# update site_customizations SET head_tag = concat('<!-- ', head_tag, ' -->') ;
UPDATE 1
discourse=# update site_customizations SET body_tag = concat('<!-- ', body_tag, ' -->') ;
UPDATE 1

(Sam Saffron) #10

you must restart your site after this.

./launcher restart app

#11

@sam Fantastic! Thank you very much!