Add a Self-Hosted Site Settings

Hey,

Things are coming along nicely so far, but I've run into a dead end. I would like to keep the "Add a Site" option. But I need to get rid of the "Add blog hosted at Edublogs" and retain the "Add Edublogs Campus Site" functionality, because these are all self-hosted websites... and I need to user to be able to input their new site's URL and then login info.

I was looking at the WelcomeViewController.m file, specifically:

_buttonTitles = @[@[NSLocalizedString(@"Add blog hosted at Edublogs", nil), NSLocalizedString(@"Add Edublogs Campus Site", nil)]];
        _sectionHeaderTitles = @[NSLocalizedString(@"Add an existing Site:", nil), NSLocalizedString(@"Start a new Site:", nil)];

Which allowed me to take out the last option (I believe it was start a new blog at Edublogs), but if I delete the "Add blog hosted at Edublogs," the "Add Edublogs Campus Site" screen doesn't allow me to input the URL. I will attach screenshots in the comments.

Basically - I want one option, and I want that option to match the functionality of "Add Edublogs Campus Site" where the user enters their URL, username and password.

And I'd like to remove the "Don't have a site? Sign up" line on the app's login screen.

Can anyone provide me with some guidance?

Thanks!

    • Tyler Postle

      Hey Rashad,

      Hope you're doing well today and thanks for your question!

      To be honest, I haven't actually created an iOS app yet, and I'm assuming, if you've gotten this far, that you've already found and been following along with the documentation? I took a look through it and as you likely already know it doesn't mention anything for the customization you're after.

      I'll call in SLS(coding experts) on this one so we can get their valuable input! They should be around soon :slight_smile:

      Thanks for being a WPMU DEV member! In the meantime, let us know if you have any other questions - we're more than happy to help.

      All the best,
      Tyler

  • Jack Kitterhing

    Hi there @Rashad,

    Hope you're well today and thanks for your question! :slight_smile:

    If you wish to retain the add Edublogs Campus Press site functionality, you should be able to remove part of the following.

    _buttonTitles = @[@[NSLocalizedString(@"Add blog hosted at Edublogs", nil), NSLocalizedString(@"Add Edublogs Campus Site", nil)]];
            _sectionHeaderTitles = @[NSLocalizedString(@"Add an existing Site:", nil), NSLocalizedString(@"Start a new Site:", nil)];

    That's what you had above, did you remove all that part within the code? Or just the edublogs part, in my testing if I remove

    @[NSLocalizedString(@"Add blog hosted at Edublogs", nil),

    Of that, the add campus press part still works correctly, is that what you tried in your initial testing?

    Also can you confirm if your testing this on a iOS device, or the Emulator?

    Thank you!

    Kind Regards
    Jack.

    • Rashad

      Hey Jack, no it does not work. As I mentioned in my initial post - when I do that, it leaves the option labeled as "Add Edublogs Campus Site," but when I click that, it no longer gives me the option to enter a URL. See attached screenshots. Just to be clear, that section now looks like:

      _buttonTitles = @[@[NSLocalizedString(@"Add Edublogs Campus Site", nil)]];
              _sectionHeaderTitles = @[NSLocalizedString(@"Add an existing Site:", nil), NSLocalizedString(@"Start a new Site:", nil)];

      Dose not not preserve that option I need however.

  • Jack Kitterhing

    Hi there @Rashad,

    Hope you're well today! :slight_smile:

    Thanks for your patience here, after doing some further investigation here, I can replicate your exact issue here.

    I've spoken with our lead app developer and he's suggested removing it completely from the table, though he'll need to check on that,
    I've notified @S H Mohanjith of this post. :slight_smile:

    Thanks again for your patience here.

    Kind Regards
    Jack.

  • S H Mohanjith

    You need to adjust the following methods also to match the new indexes (since you have removed some items from the array of button labels.

    - (BOOL)isIndexPathForAddSelfHostedBlog:(NSIndexPath *)indexPath
    {
    return indexPath.section == 0 && indexPath.row == 1;
    }

    - (BOOL)isIndexPathForAddWordPressDotComBlog:(NSIndexPath *)indexPath
    {
    return indexPath.section == 0 && indexPath.row == 0;
    }

    - (BOOL)isIndexPathForCreateWordPressDotComBlog:(NSIndexPath *)indexPath
    {
    return indexPath.section == 1 && indexPath.row == 0;
    }

    Thanks!

      • Rashad

        Scratch that, I found it, all I did was remove

        if (_createAccountLabel == nil) {
                _createAccountLabel = [[UILabel alloc] init];
                _createAccountLabel.numberOfLines = 2;
                _createAccountLabel.lineBreakMode = NSLineBreakByWordWrapping;
                _createAccountLabel.textAlignment = NSTextAlignmentCenter;
                _createAccountLabel.backgroundColor = [UIColor clearColor];
                _createAccountLabel.textColor = [UIColor whiteColor];
                _createAccountLabel.font = [UIFont fontWithName:@"OpenSans" size:15.0];
                _createAccountLabel.text = NSLocalizedString(@"Don't have an account? Create one!", @"NUX First Walkthrough Page 3 Create Account Label");
                _createAccountLabel.shadowColor = [UIColor blackColor];
                _createAccountLabel.shadowOffset = CGSizeMake(0.0, 1.0);
                UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(clickedCreateAccount:)];
                tapGestureRecognizer.numberOfTapsRequired = 1;
                _createAccountLabel.userInteractionEnabled = YES;
                [_createAccountLabel addGestureRecognizer:tapGestureRecognizer];
                [_scrollView addSubview:_createAccountLabel];
            }

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.